python.org
The installer from python.org installs on /Library/Frameworks/Python.framework/ , and only this python executable looks at the siteβs package directory for packages.
/ Library / python
In contrast, dir /Library/Python/2.7/site-packages/ is a global place where you can place python packages, all python 2.7 interpreters will be. (For example, python 2.7, which comes with OS X).
~ / Library / Python
The disk ~/Library/Python/2.7/site-packages , if one exists, is also used, but only for your user.
sys.path
Inside python, you can check which directories are currently used by import sys; print(sys.path) import sys; print(sys.path)
homegrown
Note that python installed via homebrew will place it in the $(brew --prefix)/lib/python2.7/site-packages , and it will also be able to import packages from /Library/Python/2.7/site-packages and ~/Library/Python/2.7/site-packages .
source share