问题描述
1、报错详情
执行 pip install pandas==0.24.2 -i https://pypi.tuna.tsinghua.edu.cn/simple 报错!
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pandas==0.24.2
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b2/4c/b6f966ac91c5670ba4ef0b0b5613b5379e3c7abdfad4e7b89a87d73bae13/pandas-
0.24.2.tar.gz (11.8 MB)
---------------------------------------- 11.8/11.8 MB 59.4 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [15 lines of output]
C:\Users\HGP\AppData\Local\Temp\pip-install-46eco03k\pandas_dc457d5d768f428fb303fd3905c3cd3c\setup.py:12: DeprecationWarning:
pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
D:\Users\HGP\anaconda3\envs\niid_env\lib\site-packages\setuptools\__init__.py:80: _DeprecatedInstaller: setuptools.installer
and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
error in pandas setup command: 'install_requires' must be a string or list of strings containing valid project/version requir
ement specifiers; Expected end or semicolon (after version specifier)
pytz >= 2011k
~~~~~~~^
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
2、按照提示执行
pip install --use-pep517 pandas==0.24.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
继续报错:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pandas==0.24.2
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b2/4c/b6f966ac91c5670ba4ef0b0b5613b5379e3c7abdfad4e7b89a87d73bae13/pandas
-0.24.2.tar.gz (11.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [4 lines of output]
<string>:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resource
s.html
error in pandas setup command: 'install_requires' must be a string or list of strings containing valid project/version requir
ement specifiers; Expected end or semicolon (after version specifier)
pytz >= 2011k
~~~~~~~^
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
3、尝试更换python版本(报错版本为3.8)
在网站了解到pandas-0.24.2所支持的版本如下:
4、python版本更换为3.7
执行
conda install python=3.7 命令
5、重新执行
pip install pandas==0.24.2 -i https://pypi.tuna.tsinghua.edu.cn/simple 如此不会报错了!