Mac 刪除/卸載 自己安裝的python


官網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

清除后可再次查看鏈接,會發現鏈接已清除

附圖:

這里寫圖片描述

這里寫圖片描述

這里寫圖片描述

可參考: 
https://stackoverflow.com/questions/22774529/what-is-the-safest-way-to-removing-python-framework-files-that-are-located-in-di


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM