Mac 删除/卸载 自己安装的 Python

官网pkg安装的python版本

第一步:删除框架

sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.71

第二步:删除应用目录

sudo rm -rf /Applications/Python 2.71

第三步:删除指向python的链接

cd /usr/local/bin/ls -l /usr/local/bin | grep '/Library/Frameworks/Python.framework/Versions/2.7'                             # 查看链接brew prune                  # 清除链接和目录12345

清除后可再次查看链接,会发现链接已清除

附图:

这里写图片描述

这里写图片描述

这里写图片描述

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


homebrew安装的python版本

命令卸载:

brew uninstall python1

最后,推荐使用homebrew安装python: 
1. 可以指定python版本 
2. 安装卸载都方便,避免对系统自带的python版本误操作 
3. 安装某些软件时会连带安装python包,如果系统中已安装该版本包,但不是用brew安装的,就会引起冲突,导致安装失败

Homebrew only supports building against the System-provided Python or abrewed Python. In particular, Pythons installed to /Library can interferewith other software installs.123

homebrew只支持编译系统默认和brew安装的python版本

来源python安装路径
系统默认/System/Library/Frameworks/Python.framework/Versions/2.7
brew安装/usr/local/Cellar
官网pkg安装/Library/Frameworks/Python.framework/Versions/2.7

相关文章

现在给大家介绍一下如何查询MAC的生产日期,希望对你查询MAC...
1、点击【编辑虚拟机设置】,转到【CD/DVD (SATA)】,选中【...
注意:用哪个版本的 Python 运行安装脚本,pip 就被关联到哪...
Mac 安装nvm
Mac(M1)安装VMware虚拟机及Linux系统
Mac 如何安装 Telnet,mac安装telnet命令