python - 如何在 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)
解决方案
推荐阅读
- facebook - Facebook API 发送消息:如何发送链接
- javascript - Cesium实时使用本地时间而不是UTC
- c# - 如果我从其他 UC 调用代码,WPF 绑定问题
- google-apps-script - 为什么这个脚本不收集所有的 gmail?
- python - 为什么当 k 是迭代器时 zip(*k) 不能工作?
- java - Spring Boot 优雅关闭
- php - 使用 REST Web 服务将图像上传到资源
- reactjs - 使用 react-vis 在 x 轴中以(MM-DD)格式显示日期
- symfony - Symfony 表单查询生成器
- reactjs - 如何修复“初始化时 DeltaPatcher 应接收基本 Bundle”?