文章目录
- brew search python brew install python@3.8 (指定版本号)
- 打开终端,输入 which python3 查看路径 /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
- open ~/.bash_profile
- (路径用第2步查看到的) export PATH=${PATH}:/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
- alias python=”/Library/Frameworks/Python.framework/Versions/3.7/bin/python3″
- (直接关闭就可以)
- source ~/.bash_profile 如果报错: no such file or directory : /User/XX/.profile 执行命令: 1) touch ~/.profile 2) open ~/.profile 3)写入 exprot PATH=/user/local/bin:/user/bin:/user/sbin:/sbin 4) 再执行 source ~/.bash_profile
- python检查Python版本 python -V
目录
- Mac修改默认Python版本
- 1.安装Python 3
- 2.查看Python3 安装路径
- 3.打开配置文件
- 4.写入外部环境变量
- 5.重命名Python
- 6.关闭文件
- 7.终端执行命令
- 8.终端执行命令
- 总结
brew search python
brew install python@3.8 (指定版本号)
打开终端,输入
which python3
查看路径
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
open ~/.bash_profile
(路径用第2步查看到的)
export PATH=${PATH}:/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
alias python="/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"
(直接关闭就可以)
source ~/.bash_profile
如果报错:
no such file or directory : /User/XX/.profile
执行命令:
1) touch ~/.profile 2) open ~/.profile 3)写入 exprot PATH=/user/local/bin:/user/bin:/user/sbin:/sbin 4) 再执行 source ~/.bash_profile
python检查Python版本
python -V
以上为个人经验,希望能给大家一个参考,也希望大家多多支持风君子博客。
您可能感兴趣的文章:
- 如何在mac版pycharm选择python版本
- mac下pycharm设置python版本的图文教程