I am working on a mac, a quick question, could someone told me the difference of these two directories?
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
/Library/Python/2.7/site-packages/
The installer from python.org installs to /Library/Frameworks/Python.framework/
, and only that python executable looks in the contained site-package dir for packages.
In contrast, the dir /Library/Python/2.7/site-packages/
is a global place where you can put python packages, all python 2.7 interpreter will. (For example the python 2.7 that comes with OS X).
The dir ~/Library/Python/2.7/site-packages
, if it exists, is also used but for your user only.
From within python, you can check, which directories are currently used by import sys; print(sys.path)
Note, a python installed via homebrew, will put it's site-packages in $(brew --prefix)/lib/python2.7/site-packages
but also be able to import packages from /Library/Python/2.7/site-packages
and ~/Library/Python/2.7/site-packages
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With