第一步:刪除框架python
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
第二步:刪除應用目錄bash
sudo rm -rf "/Applications/Python 2.7"
第三步:刪除指向python的連接框架
cd /usr/local/bin/ ls -l /usr/local/bin | grep '/Library/Frameworks/Python.framework/Versions/2.7' # 查看連接 brew prune # 清除連接和目錄
清除後可再次查看連接,會發現連接已清除ide
附圖:ui
命令卸載:.net
brew uninstall python
最後,推薦使用homebrew安裝python:
1. 能夠指定python版本
2. 安裝卸載都方便,避免對系統自帶的python版本誤操做
3. 安裝某些軟件時會連帶安裝python包,若是系統中已安裝該版本包,但不是用brew安裝的,就會引發衝突,致使安裝失敗code
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.
homebrew只支持編譯系統默認和brew安裝的python版本server
來源 | 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/78608704blog