【发布时间】:2019-08-27 09:00:10
【问题描述】:
我正在尝试在我的 ubuntu 机器上安装 pandas 库,但没有安装。
pip install pandas
pip3 install pandas
我用过 pip install pandas
Downloading/unpacking pandas
Downloading pandas-0.25.1.tar.gz (12.6MB): 12.6MB downloaded
Running setup.py (path:/tmp/pip-build-WzvvgM/pandas/setup.py) egg_info for package pandas
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-WzvvgM/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
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-WzvvgM/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
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-WzvvgM/pandas
Storing debug log for failure in /home/user508/.pip/pip.log
【问题讨论】:
-
什么是
python -V和pip --version? -
对我来说似乎是为 Python 2 安装的 -
pandas>=0.25放弃了对 Python 2.7 和 3.5 之前的所有 Python 3 版本的支持,因此请使用pip install "pandas<0.25"。 -
我认为使用
pipenv或virtualvenv可以避免这个问题。