我正在尝试 pip install pandas 但遇到了一些麻烦

我正在尝试 pip install pandas 但遇到了一些麻烦

在终端中,我运行命令

Jareds-MacBook-Pro:~ jaredamodio$ pip install pandas

结果是:

Collecting pandas
  Using cached https://files.pythonhosted.org/packages/52/ff/912fe03a623a70bcf297d466013a0b4f4c68c3b60f86bf226682d061fc09/pandas-0.24.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting python-dateutil>=2.5.0 (from pandas)
  Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting numpy>=1.12.0 (from pandas)
  Using cached https://files.pythonhosted.org/packages/8f/0b/1a2c21bb69138337dc079841aa4a45e5b2fc7a4260c0907f5254fb08f02e/numpy-1.16.4-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Requirement already satisfied: pytz>=2011k in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pandas) (2013.7)
Collecting six>=1.5 (from python-dateutil>=2.5.0->pandas)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, numpy, pandas
  Found existing installation: six 1.4.1
Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

问题显然出现在该消息的最后一部分,以“发现现有安装:six 1.4.1 ...”开头。

我该如何解决这个问题来安装熊猫?

这可能是一个非常基本的问题;我对此很陌生,并且没有安装太多 pip,我很感激您提供的任何指导!

答案1

据互联网,解决这个问题的一种方法是使用--ignore-installed例如:

pip install pandas --ignore-installed six

或者可能:

pip install pandas --ignore-installed six --user

话虽如此,似乎也有非常合理的建议,让您自己安装另一个版本的 Python(例如通过homebrew)或使用 Python 虚拟环境来解决此问题。[这些可能是我推荐的。]


请注意,给定的链接中还列出了更多选项,以防您需要它们。


相关内容