I have a Python installation on OS X (10.10; supported simply by pip) with my site packages in
/Library/Python/2.7/site-packages
Apple's packages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
and standard Apple Python installation in
/System/Library/Frameworks/Python.framework/Versions/2.7
I have not done anything special to set this up, so I assume it is pretty standard. I install my packages in the site package directory, and the only thing I did to “configure” was to trim Apple packages that I don’t need, or duplicate them in the package directory of my site.
Everything works fine, and all my paths are what I expected; however i get a confusing result when i
python -m site
So far this shows sys.path , which makes sense to me
sys.path = [ '/Users/Rax', '/Users/Rax/Documents/Projects/Coding/Python', # From PYTHONPATH '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Python/2.7/site-packages', ]
I also get
USER_BASE: '/Users/Rax/Library/Python/2.7' (doesn't exist) USER_SITE: '/Users/Rax/Library/Python/2.7/lib/python/site-packages' (doesn't exist) ENABLE_USER_SITE: True
which does not make sense to me.
Shouldn't USER_SITE be /Library/Python/2.7/site-packages ? If so, how can I install it (I cannot install USER_SITE in /Library/Python/2.7/ because lib/python/ added to the path)?
This doubly confuses me, because /Library/Python/2.7/site-packages correctly added to my sys.path (I don’t know how) and because
import pkg_resources pkg_resources.__file__
gives /Library/Python/2.7/site-packages/pkg_resources.pyc .