在終端機中,我運行命令
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.
該問題顯然出現在該訊息的最後部分,以“發現現有安裝:六個 1.4.1 ...”開頭
我怎麼能解決這個問題來安裝pandas?
這可能是一個非常基本的問題;我對此非常陌生,並且沒有安裝太多 pip,我感謝您提供的任何指導!
答案1
根據網路報道,解決這個問題的一種方法是使用--ignore-installed
例如:
pip install pandas --ignore-installed six
或者可能:
pip install pandas --ignore-installed six --user
也就是說,似乎有非常合理的建議可以自行安裝另一個版本的 Python(例如 via homebrew
)或使用 Python 虛擬環境來解決這個問題。 [這些可能是我推薦的。 ]
請注意,給定連結中還列出了更多選項,以防您需要它們。