异常如下:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ME1CPH/pandas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ME1CPH/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-ME1CPH/pandas/
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-ME1CPH/pandas/setup.py", line 21, in <module>
import versioneer
File "versioneer.py", line 1629
print("Adding sample versioneer config to setup.cfg", file=sys.stderr)
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
使用pip install pandas默认安装的是最新版的pandas,因为pandas版本0.24.0以后的版本不再支持python2.7,因此指定pandas0.23.0及以前的版本即可。例如:
pip install pandas==0.23.0 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com