跟小D每日学口语

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

posted @ 2018-01-05 14:52  Danny Chen  阅读(36417)  评论(0编辑  收藏  举报