Question

I broke my Mercurial install . So I reinstalled Python-2.7 on 64-bit Mac Os 10.6 ( Snow Leopard ) with python-2.7.2-macosx10.6.dmg . I have the folder /Library/Frameworks/Python.framework/Versions/2.7/ . Python 2.7.2 can be interpreted

The folder /usr/lib/python2.6 exits but not python2.7 . It seems the PYTHONPATH variable environment must be set to /usr/lib/python-latest-version

Also I don't have a /Library/Python/2.7 either. It does not seem like a bad install

How to get this /usr/lib/python2.7 folder right ? Can I create it manually ?

Was it helpful?

Solution

Most Python framework builds on OS X, in particular the python.org Pythons like you installed, do not use /usr/lib/python*. You can find the location of the standard library and for Distutils-installed site packages using the sysconfig module in the Python standard library:

$ python2.7
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.
>>> import sysconfig
>>> sysconfig.get_path('stdlib')
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7'
>>> sysconfig.get_path('purelib')
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top