python-3.x - Pandas 1.0.0 与 python 3.5 不兼容

标签 python-3.x pandas pip

我有一个安装了 python 3.5.2 的虚拟环境。

如果我尝试使用假版本号安装 Pandas,例如通过执行 pip install Pandas==x 我可以看到匹配的发行版是:

Could not find a version that satisfies the requirement Pandas==x.x. (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==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

因为它使用 f-string,从 python 3.6 开始可用。

为什么 pip 显示不兼容的版本?它不应该只显示我能够安装的版本吗?

最佳答案

显然,pip 显示了该包的所有可用版本,无论 Python 版本要求如何。

以下部分documentation建议:

Since version 6.0, pip also supports specifiers containing environment markers like so:

SomeProject ==5.4 ; python_version < '2.7'
SomeProject; sys_platform == 'win32'

python_version 与包的版本分开指定。

运行pip时可以通过以下方式设置(默认为解释器版本):

pip install --python-version= pandas==

关于python-3.x - Pandas 1.0.0 与 python 3.5 不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60077573/

相关文章:

pip - 如何修复在 Spyder 5.0.3 中执行 pip 时出现的错误

json - 如何从 C3.ai COVID-19 API 请求 JSON 响应?

python-3.x - Seaborn 增加颜色数量

python - np.where np.nan 的处理(NaN 评估为值 < 0)

python - 在 Pandas 的杂草中使用切片器进行多重索引

python - entry_points 不会在 Python 中使用 pip 或 easy_install 创建自定义脚本?

python-3.x - 在 jupyter notebook 中打开 .csv 文件时出现 dtype 错误

python - 如何在 Python 中使用 QTextBrowser 代替控制台?

python - 按一列或另一列对 pandas 数据框进行分组

python - 在 Windows 上安装 Python pip SyntaxError : EOF while scanning triple-quoted string literal