What is the difference between "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/" and "/Library/Python/2.7/"

I am working on a mac, quick question, can someone tell 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/

+4
source share
1 answer

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 .

+6
source

Source: https://habr.com/ru/post/1445680/


All Articles