删除mac上自己安装的的python(我是安装的python3.6,所以以python3.6为例)
1. 删除Python 3.6 框架,打开终端,输入
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.6
2. 删除 Python 3.6 应用目录
cd /Applications
sudo rm -rf Python 3.6
3. 删除/usr/local/bin 目录下指向的Python3.6的连接
ls -l /usr/local/bin | grep ‘/Library/Frameworks/Python.framework/Versions/3.6’ | awk ‘{print $9}’ | tr -d @ | xargs rm
4.查看链接是否删除成功
ls -l /usr/local/bin | grep ‘/Library/Frameworks/Python.framework/Versions/3.6’
5. 删除 Python 的环境路径
vi ~/.bash_profile
6. 确认python 是否已经删除
python3
-bash: python3.6: command not found