Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing python package fails with Package 'example' requires a different Python: 2.7.12 not in '>=2.5, >=3.0' , although version should fit

Tags:

I'm trying to install a python package, but it fails with :

pip2 install ./example-0.1.0-py2-none-any.whl

ERROR: Package 'example' requires a different Python: 2.7.12 not in '>=2.5, >=3.0'

So this error message is wrong imo , 2.7.12 is obviously >=2.5 .

This seems to only fail with new pip versions and python2. All other combinations of python/pip/setuptools seem to work, see the table below for more details.

Testing results

Does anyone have an idea ?

like image 783
KoKlA Avatar asked Dec 21 '19 23:12

KoKlA


1 Answers

The metadata field Requires-Python uses the version specifiers syntax which is documented in PEP 440:

The comma (",") is equivalent to a logical and operator

2.7.12 is not greater than both >=2.5 and >=3.0, therefore the installation should be refused.

The package metadata is likely incorrect. They could have just used >=2.5, since that already includes anything >=3.0.

Older versions of pip don't parse the Requires-Python field. The checks on this metadata only work with pip>=9.0.0.

like image 110
wim Avatar answered Sep 30 '22 19:09

wim