升级macOS 12.4后,python无法使用

电脑系统升级后,python报错,解决方案:

使用repo命令,提示需要安装python;安装后还是一直提示安装;


sudo ln -s /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8 /usr/local/bin/python3

sudo ln -s -f /usr/local/bin/python3 /usr/local/bin/python

执行以上两行命令,会在/usr/local/bin/目录下生成,python3与python的快捷引用方式;

注意此目录为你的python目录(版本需要对应自己的版本号):/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8

which python3查找python路径


参考链接:

Python3

https://www.zhihu.com/question/420273182

http://events.jianshu.io/p/046da62bd527

https://cloud.tencent.com/developer/article/1967674

/usr/local/bin/python3

/usr/bin/python3

你可能感兴趣的:(升级macOS 12.4后,python无法使用)