但是在这些位置运行两个python给了我[GCC 4.2.1 (Apple Inc. build 5646)] on darwin。它们是否都引用了提供的相同内置python mac?
我还读到安装macpython会
A MacPython2.5 folder in your Applications folder.In here you
find IDLE, the development environment that is a standard part of
official Python distributions...
I’m a little confused with the python on osx. I do not know if the previous owner of the laptop has installed macpython using macport. And I remembered that osx has an builtin version of python. I tried using type -a python and the result returned
python is /usr/bin/python
python is /usr/local/bin/python
However running both python at these locations give me [GCC 4.2.1 (Apple Inc. build 5646)] on darwin. Do they both refer to the same builtin python mac provided?
I also read that installing macpython one would
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...
I looked at Applications, and theres a MacPort folder with python2.6 and the mentioned stuff in it. But running IDLE, i find the same message as above.
Hmm I’m a little confused. Which is which?
回答 0
[GCC 4.2.1 (Apple Inc. build 5646)]是构建Python的GCC版本,而不是Python本身的版本。该信息应在前一行。例如:
# Apple-supplied Python 2.6 in OS X 10.6
$ /usr/bin/python
Python2.6.1(r261:67515,Jun242010,21:47:49)[GCC 4.2.1(AppleInc. build 5646)] on darwin
Type"help","copyright","credits"or"license"for more information.>>># python.org Python 2.7.2 (also built with newer gcc)
$ /usr/local/bin/python
Python2.7.2(v2.7.2:8527427914a2,Jun112011,15:22:34)[GCC 4.2.1(AppleInc. build 5666)(dot 3)] on darwin
Type"help","copyright","credits"or"license"for more information.>>>
[GCC 4.2.1 (Apple Inc. build 5646)] is the version of GCC that the Python(s) were built with, not the version of Python itself. That information should be on the previous line. For example:
# Apple-supplied Python 2.6 in OS X 10.6
$ /usr/bin/python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
# python.org Python 2.7.2 (also built with newer gcc)
$ /usr/local/bin/python
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
Items in /usr/bin should always be or link to files supplied by Apple in OS X, unless someone has been ill-advisedly changing things there. To see exactly where the /usr/local/bin/python is linked to:
Btw it’s easy to find out where you can find a specific binary: which Python will show you the path of your Python binary (which is probably the same as I posted above).