I have a Python installation on OS X (10.10; maintained simply with pip) with my site packages in
/Library/Python/2.7/site-packages
Apple's packages in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
and the standard Apple Python installation in
/System/Library/Frameworks/Python.framework/Versions/2.7
I did nothing special to set this up, so I assume it is pretty standard. I install my packages in the site packages directory, and the only thing I have done to "customize" is to prune the Apple packages I don't need or that duplicate ones I maintain in my site packages directory.
Everything works fine, and all my paths seem to be just what I'd expect; however I get a confusing result when I
python -m site
While this shows a sys.path
that 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 doesn't make sense to me.
Shouldn't USER_SITE
be /Library/Python/2.7/site-packages
? If so, how do I set it (I can't by setting USER_SITE
to /Library/Python/2.7/
because lib/python/
is added to the path)?
This is doubly confusing to me because /Library/Python/2.7/site-packages
is correctly added to my sys.path
(from where I don't know) and because
import pkg_resources
pkg_resources.__file__
yields /Library/Python/2.7/site-packages/pkg_resources.pyc
.