One - One Code All

Blog Content

在Mac上删除自己安装的Python

Python Linux-Mac   2017-08-18 18:08:23

推荐使用 Homebrew 来安装第三方工具。自己安装的python散落在电脑各处,删除起来比较麻烦。今天在此记录一下删除的过程(本人以Python3.6为例)。


删除Python 3.6 framework

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


删除Python 3.6 应用目录

sudo rm -rf "/Applications/Python 3.6"


删除/usr/local/bin 目录下指向的Python3.6的连接

cd /usr/local/bin/

ls -l /usr/local/bin | grep '/Library/Frameworks/Python.framework/Versions/3.6' | awk '{print $9}' | tr -d @ | xargs rm


如果需要的话,编辑配置路径的环境文件,例如 ~/.bash_login, ~/.bash_profile, ~/.cshrc, ~/.profile, ~/.tcshrc, and/or ~/.zprofile,当初安装的时候,默认是将Python3.6的信息配置在 ~/.bash_profile 文件中,将其相关信息删除



上一篇:Linux shell获得当前目录、上级目录、目录的最后部分
下一篇:Mac安装多个Python版本

The minute you think of giving up, think of the reason why you held on so long.