1、删除Python框架
sudo rm -rf /Library/Frameworks/Python.framework/Versions/x.x
2、删除Python程序
sudo rm -rf “/Applications/Python x.x”
3、删除/usr/local/bin目录下的Python连接
删除/usr/local/bin目录下的Python连接
ls -l /usr/local/bin | grep ‘/Library/Frameworks/Python.framework/Versions/x.x’ | awk ‘{print $9}’ | tr -d @ | xargs rm
删除前后可使用命令查看:
ls -l /usr/local/bin | grep ‘/Library/Frameworks/Python.framework/Versions/x.x’
x.x为Python的版本号。例如3.6.3为3.6。