pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.49k stars 3.01k forks source link

Problem Installing Celery==5.2.0 Due to Invalid Metadata #12793

Closed JerryHamm closed 3 months ago

JerryHamm commented 3 months ago

Description

I encountered an issue while trying to install celery==5.2.0 in my Docker build process. The installation fails due to invalid metadata in the specified version of Celery. The error message indicates that the metadata has an unexpected character which prevents the installation from proceeding.

Expected behavior

Celery version 5.2.0 should install without any errors.

pip version

24.1

Python version

3.10.12

OS

Linux

How to Reproduce

  1. Make sure pip version is 24.1
  2. pip install celery==5.2.0

Output

$ pip install celery==5.2.0
Defaulting to user installation because normal site-packages is not writeable
Collecting celery==5.2.0
  Using cached celery-5.2.0-py3-none-any.whl.metadata (20 kB)
WARNING: Ignoring version 5.2.0 of celery since it has invalid metadata:
Requested celery==5.2.0 from https://files.pythonhosted.org/packages/76/f3/1299844327e0da1a89dfeffc0ee72dee80ed029df60c1634be708e7115fb/celery-5.2.0-py3-none-any.whl has invalid metadata: Expected matching RIGHT_PARENTHESIS for LEFT_PARENTHESIS, after version specifier
    pytz (>dev)
         ~^
Please use pip<24.1 if you need to use this version.
ERROR: Ignored the following yanked versions: 5.0.6, 5.2.5
ERROR: Could not find a version that satisfies the requirement celery==5.2.0 (from versions: 0.1.2, 0.1.4, 0.1.6, 0.1.7, 0.1.8, 0.1.10, 0.1.11, 0.1.12, 0.1.13, 0.1.14, 0.1.15, 0.2.0, 0.3.0, 0.3.7, 0.3.20, 0.4.0, 0.4.1, 0.6.0, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 2.2.9, 2.2.10, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.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7, 5.3.0a1, 5.3.0b1, 5.3.0b2, 5.3.0rc1, 5.3.0rc2, 5.3.0, 5.3.1, 5.3.4, 5.3.5, 5.3.6, 5.4.0rc1, 5.4.0rc2, 5.4.0)
ERROR: No matching distribution found for celery==5.2.0

Code of Conduct

JerryHamm commented 3 months ago

sudo pip install celery=5.2.0 seems to solve the issue though

notatallshaw commented 3 months ago

sudo pip is probably using an older version of pip, try sudo pip -V and see what is says.

This package's requirement metadata is not valid, and no longer works with pip 24.1+, if you require that older package you will need to use pip 24.0.

JerryHamm commented 3 months ago

Yes you are right sudo pip was using 22.0.2 .

I have already reverted pip to 24.0 and it works perfectly. Thanks for you assistance!

edmorley commented 3 months ago

Another option is to upgrade to Celery 5.2.1+ since this issue was fixed in: https://github.com/celery/celery/pull/7074 https://github.com/celery/celery/commit/011dc063719c7bce9c105a8e86095a0ccbf7cb1e