简体   繁体   English

安装 python 包失败,包 'example' requires a different Python: 2.7.12 not in '>=2.5, >=3.0' ,虽然版本应该适合

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

I'm trying to install a python package, but it fails with :我正在尝试安装一个 python 包,但它失败了:

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'错误:包“示例”需要不同的 Python:2.7.12 不在“>=2.5,>=3.0”中

So this error message is wrong imo , 2.7.12 is obviously >=2.5 .所以这个错误信息是错误的 imo , 2.7.12 显然是 >=2.5 。

This seems to only fail with new pip versions and python2.这似乎只会在新的 pip 版本和 python2 中失败。 All other combinations of python/pip/setuptools seem to work, see the table below for more details. python/pip/setuptools 的所有其他组合似乎都有效,有关更多详细信息,请参见下表。

测试结果

Does anyone have an idea ?有没有人有想法?

The metadata field Requires-Python uses the version specifiers syntax which is documented in PEP 440 :元数据字段Requires-Python使用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. 2.7.12不大于两个> = 2.5和> = 3.0,因此安装应拒绝更大。

The package metadata is likely incorrect.包元数据可能不正确。 They could have just used >=2.5, since that already includes anything >=3.0.他们本可以使用 >=2.5,因为这已经包含了 >=3.0 的任何内容。

Older versions of pip don't parse the Requires-Python field.旧版本的pip不解析Requires-Python字段。 The checks on this metadata only work with pip>=9.0.0 .对此元数据的检查仅适用于pip>=9.0.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM