我对 osx 上的 python 有点困惑。我不知道笔记本电脑的前主人是否使用 macport 安装了 macpython。我记得 osx 有一个内置版本的 python。我尝试使用 type -a python
并返回结果
python is /usr/bin/python
python is /usr/local/bin/python
但是在这些位置运行两个 python 给我 [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
。它们是否都引用了提供的相同的内置 python mac?
我还读到安装 macpython 会
A MacPython 2.5 folder in your Applications folder. In here you
find IDLE, the development environment that is a standard part of
official Python distributions...
我查看了 Applications
,并且有一个 MacPort
文件夹 python2.6
以及其中提到的内容。但是运行 IDLE,我发现与上面相同的消息。
嗯,我有点困惑。哪个是哪个?
原文由 goh 发布,翻译遵循 CC BY-SA 4.0 许可协议
[GCC 4.2.1 (Apple Inc. build 5646)]
是构建 Python 的 GCC 版本,而不是 Python 本身的版本。该信息应该在前一行。例如:/usr/bin
中的项目应该始终是或链接到 Apple 在 OS X 中提供的文件,除非有人不明智地在那里进行了更改。要准确查看/usr/local/bin/python
链接到的位置:在这种情况下,这对于 python.org 安装的 Python 实例来说是典型的,或者它可能是从源代码构建的。