有没有一种简单的方法可以在 OS X 机器上运行 Python 2.7 和 3.2?我一直在使用 IDLE 和 Python 3.2,并且有许多使用 Python 3 编写的程序,所以我真的不想卸载 3。但是,我正在做一个使用 2.7 作为其大部分基本代码的作业,所以我希望能够运行 2.7。
最佳答案
OS X 10.7 和 10.8 预装了 Python 2.7; /usr/bin/python
:
$ /usr/bin/python2.7
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
但是,并不禁止安装其他版本的 python; Python for Mac 2.7.3安装程序不会干扰系统安装或您的 Python 3 安装。
关于python - 在同一台机器上运行 Python 3.2 和 2.7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12572156/