网络编程
位置:首页>> 网络编程>> Python编程>> 在Mac上删除自己安装的Python方法

在Mac上删除自己安装的Python方法

作者:transformer_WSZ  发布时间:2021-03-22 22:10:57 

标签:Mac,删除,Python

推荐使用 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 文件中,将其相关信息删除。

来源:https://blog.csdn.net/transformer_WSZ/article/details/77887912

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com