2022-01-23
阅读量:
727
MAC系统如何修改python默认版本?
1.安装Python 3.10
https://www.python.org/downloads/
2.查看Python 3.10安装路径
打开终端,输入
which python3
查看路径 /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.10
3.打开配置文件
open ~/.bash_profile
4.写入外部环境变量(路径用第2步查看到的)
export PATH=${PATH}:/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10
5.重命名Python
alias python="/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10"
6.关闭文件(直接关闭就可以)
7.终端执行命令:
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
8.终端执行命令:python检查Python版本
python -V
原文链接:https://blog.csdn.net/qq_31812703/article/details/113728467






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论