1. python安装
官网下载:https://www.python.org/downloads/
环境变量设置:vim ~/.bash_profile
path=/Users/uxin/python3.7.exe:${PATH}
执行:source ~/.bash_profile
#python
注:也可以不安装Python,直接安装anaconda3,anaconda3中自带Python
参考:anaconda安装指导:https://blog.csdn.net/qq_15550449/article/details/84680420
2.卸载Python
Mac系统自带的python环境在:
Python 2.7.10: /System/Library/Frameworks/Python.framework/Versions/2.7
用户安装的python环境默认环境在
/Library/Frameworks/Python.framework/Versions/:
删除框架:sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.6 (3.6:python版本)
删除应用目录:sudo rm -rf "/Applications/Python 3.6
删除指向python的链接:
cd /usr/local/bin/
ls -l /usr/local/bin | grep '/Library/Frameworks/Python.framework/Versions/2.7'
清除链接和目录
brew prune
安装过程出现问题解决方案:
执行brew prune 命令提示 -bash: brew: command not found,homebrew安装有问题,卸载重新安装
卸载:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/unstall)"
安装homebrewe:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
其他:
Mac系统自带的python环境默认启动路径在:/usr/bin 用户安装的python环境默认启动路径在:/usr/local/bin 终端输入: “python”命令会执行/usr/local/bin下的“python”——在没有配置文件改变该默认路径的条件下。
3.Homebrew使用
搜索软件:brew search 软件名,如brew search wget
安装软件:brew install 软件名,如brew install wget
卸载软件:brew remove 软件名,如brew remove wget
卸载:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/unstall)"
安装homebrewe:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"