简体   繁体   English

Pip 列出与 Python 版本不兼容的包版本

[英]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.

相关问题 给定 Python 的维护版本,pip 是否共享相同版本的包? - Does pip share the same versions of a package given a maintenance version of Python? 为什么 pip 安装了不兼容的软件包版本? - Why is pip installing an incompatible package version? Pip安装包不兼容Python版本 - Pip installing packages incompatible to Python version 如何为Python管理部分不兼容的软件包版本? - How to manage partly incompatible package versions for Python? pip 在安装兼容的包版本时是否考虑了实际的 Python 版本? - Does pip take into account the actual Python version when installing compatible package versions? 为什么 python 包使用 __version__ 和 pip (同一目录)显示不同的版本 - Why a python package shows different versions using __version__ and pip (same directory) Python package(tensorflow)显示pip列表和.__version__ZD148E6221F39893之间的版本不匹配 - Python package (tensorflow) displays mismatching versions between pip list and .__version__ output 在 Python 的 Pip 中,如何搜索与版本模式匹配的 package 的所有可能版本? - In Python's Pip, how can you search for all possible versions of a package, which match a version pattern? pip:安装软件包的版本不得超过其他软件包的版本 - pip: install package at version that don't bump versions of other packages Pip - 显示 package 的版本 - Pip - show versions of package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM