本人在從新搭建本身的電腦的plotly環境的時候遇到一個坑,就是使用pip安裝pandas的時候一直提示:python
pip uninstall numpy Cannot uninstall 'numpy'. 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.
因爲英文水平有限,期初覺得是權限不夠,加上sudo依然報錯。在藉助工具翻譯了以後,發現是沒法卸載numpy,緣由以下:git
這是一個distutils安裝的項目,所以咱們沒法準確肯定哪些文件屬於它,這將致使僅部分卸載。
原來numpy是標準庫的東西,讓我想起window系統裏面有些軟件安裝時候會放在system文件夾下,致使提示沒法準確識別須要卸載刪除的文件致使卸載失敗的狀況。雖然不清楚爲啥裝pandas須要先卸載numpy,可是使用pip先安裝了一波。提示以下:api
Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.8.0rc1)
仍是不行,乾脆直接刪除了。提醒一下先備份,而後在安裝從新安裝numpy,這樣保險一些。markdown
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python$ ls | grep numpy numpy-1.8.0rc1-py2.7.egg-info /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python$ sudo mv numpy-1.8.0rc1-py2.7.egg-info /Users/fv/ /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python$
下面放一下我安裝命令,用的源是清華的,豆瓣的老提示鏈接失敗。工具
sudo pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple numpy sudo pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple pandas
劃重點,還有一些坑: 看國外網友是3.+的版本bug比較多,我果真滾回來2.4 新電腦必定要注意相關依賴庫的版本,有時候plotly提示找不到模塊,只是由於版本過低了。ui