首页 > 解决方案 > 如何在 Mac Catalina 上将默认 python 更改为 2.7?

问题描述

Python 2.7 在 Mac Catalina 上不再可用,但我需要它作为我的默认 python 来让 Cocos Creator 正确构建 iOS 应用程序。我尝试安装 Python,并按如下方式设置别名,但是在python终端上正确键入运行 python 2.7 时,当我关闭终端时它恢复为 python 3.8.5(并且 Cocos 仍然无法正确构建)。我的 python 3 是使用 anaconda 安装的

有没有办法让 Catalina 上的 python 2.7 默认设置?

https://stackoverflow.com/questions/49704364/make-python3-as-my-default-python-on-mac
Open Terminal
cd
nano ~/.bashrc
alias python=python2 (Add this line on top of .bashrc file)
Press ctr+o (To save the file)
Press Enter
Press ctr+x (To exit the file)
source ~/.bashrc OR . ~/.bashrc (To refresh the bashrc file)

标签: pythonmacoscocos2d-x

解决方案


推荐阅读