[英]Pip lists versions of the package incompatible with the version of Python
I have a virtual environment with python 3.5.2
installed.我有一个安装了python 3.5.2
的虚拟环境。
If I try to install Pandas with a fake version number, by doing for example pip install Pandas==x
i can see that the matching distributions are:如果我尝试使用假版本号pip install Pandas==x
,例如通过pip install Pandas==x
我可以看到匹配的发行版是:
Could not find a version that satisfies the requirement Pandas==xx (from versions: 0.1, 0.2b0, 0.2b1, 0.2, 0.3.0b0, 0.3.0b2, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0rc1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0rc1, 0.8.0rc2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0rc1, 0.19.0, 0.19.1, 0.19.2, 0.20.0rc1, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21.0rc1, 0.21.0, 0.21.1, 0.22.0, 0.23.0rc2, 0.23.0, 0.23.1, 0.23.2, 0.23.3, 0.23.4, 0.24.0rc1, 0.24.0, 0.24.1, 0.24.2, 0.25.0rc0, 0.25.0, 0.25.1, 0.25.2, 0.25.3, 1.0.0rc0, 1.0.0) No matching distribution found for Pandas==x找不到满足 Pandas==xx 要求的版本(来自版本:0.1、0.2b0、0.2b1、0.2、0.3.0b0、0.3.0b2、0.3.0、0.4.0、0.4.1、0.4.2 , 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0rc1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0rc1, 0.8.0rc2, 0.8.0, 0.8 .1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1 , 0.15.2, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0rc1, 0.19.0, 0.19.1, 0.0.20.2 .0rc1, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21.0rc1, 0.21.0, 0.21.1, 0.22.0, 0.23.0rc2, 0.23.0, 0.20.32.2. , 0.23.3, 0.23.4, 0.24.0rc1, 0.24.0, 0.24.1, 0.24.2, 0.25.0rc0, 0.25.0, 0.25.1, 0.25.2, 0.25.3, 0.0rc .0) 没有找到 Pandas==x 的匹配分布
This means that Pandas==1.0.0 should be available, however, when I try to install it I get the following error:这意味着 Pandas==1.0.0 应该可用,但是,当我尝试安装它时,出现以下错误:
Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-uc6w1vdn/pandas/setup.py", line 42 f"numpy >= {min_numpy_ver}", ^ SyntaxError: invalid syntax
Because it uses f-string, available from python 3.6 onwards.因为它使用 f-string,从 python 3.6 开始可用。
Why does pip show incompatible versions?为什么 pip 显示不兼容的版本? Shouldn't it show only versions I am able to install?它不应该只显示我可以安装的版本吗?
Apparently, pip
is showing all of the available versions of the package irrespective of the Python version requirement.显然,无论 Python 版本要求如何, pip
都会显示该包的所有可用版本。
The following part of the documentation suggests that: 文档的以下部分表明:
Since version 6.0, pip also supports specifiers containing environment markers like so:从 6.0 版开始,pip 还支持包含环境标记的说明符,如下所示:
SomeProject ==5.4 ; python_version < '2.7' SomeProject; sys_platform == 'win32'
python_version
is specified separately from the version of the package. python_version
与包的版本分开指定。
You can set it in the following way in when running pip (defaults to the interpreter version):您可以在运行 pip 时按以下方式设置它(默认为解释器版本):
pip install --python-version= pandas==
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.