mac怎么删除python

991次阅读
没有评论

mac怎么删除python

mac 默认安装了python2;自己后面又安装了python3;为了方便,现在想将python3换成Anaconda3。

Anaconda是一个开源的Python发行版本,其包含了conda、Python等180多个科学包及其依赖项。

Python3安装之后,在系统中不同目录下存在各种依赖关系,下面我们一步一步来把python3.7 完全卸载,无残留。

# python3版本查看

$ python3 --version
Python 3.7.1

# 删除Python 3.7 框架:

$ ls /Library/Frameworks/Python.framework/Versions/
3.7
$ sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.7

# 删除Python 3.7 应用目录:

$ cd /Applications
$ sudo rm -rf Python\ 3.7/   #Python 3.7存在空格

查看launchpad中python3的IDLE就被删除了

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

$ cd /usr/local/bin/ 
$ ls -l /usr/local/bin
$ rm Python3.7相关的文件和链接 #Python3.7相关的文件和链接需要你自行确认

# 删除python的环境路径

$ vi ~/.bash_profile

删除Python3.7设置的环境路径。

# 确认python是否已经删除

$ python3
-bash: python3: command not found
神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:wuyou2021-07-04发表,共计694字。
新手QQ群:570568346,欢迎进群讨论 Python51学习