官網pkg安裝的python版本
第一步:刪除框架
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
- 1
第二步:刪除應用目錄
sudo rm -rf "/Applications/Python 2.7"
- 1
第三步:刪除指向python的鏈接
cd /usr/local/bin/ ls -l /usr/local/bin | grep '/Library/Frameworks/Python.framework/Versions/2.7' # 查看鏈接 brew prune # 清除鏈接和目錄
- 1
- 2
- 3
- 4
- 5
清除后可再次查看鏈接,會發現鏈接已清除
附圖:
homebrew安裝的python版本
命令卸載:
brew uninstall python
- 1
最后,推薦使用homebrew安裝python:
1. 可以指定python版本
2. 安裝卸載都方便,避免對系統自帶的python版本誤操作
3. 安裝某些軟件時會連帶安裝python包,如果系統中已安裝該版本包,但不是用brew安裝的,就會引起沖突,導致安裝失敗
Homebrew only supports building against the System-provided Python or a brewed Python. In particular, Pythons installed to /Library can interfere with other software installs.
- 1
- 2
- 3
homebrew只支持編譯系統默認和brew安裝的python版本
來源 | python安裝路徑 |
---|---|
系統默認 | /System/Library/Frameworks/Python.framework/Versions/2.7 |
brew安裝 | /usr/local/Cellar |
官網pkg安裝 | /Library/Frameworks/Python.framework/Versions/2.7 |
reference from : http://blog.csdn.net/tymatlab/article/details/78608704