What is python's site-packages directory?

What is python's site-packages directory?

( from :https://stackoverflow.com/questions/31384639/what-is-pythons-site-packages-directory/31384782)

  • site-packages is the target directory of manually built python packages. When you build and install python packages from source (using distutils, probably by executing python setup.py install), you will find the installed modules in site-packages by default.

  • There are standard locations:

Unix(pure): prefix/lib/pythonX.Y/site-packages

Unix (non-pure): exec-prefix/lib/pythonX.Y/site-packages

Windows: prefix\Lib\site-packages

(pure means that the module uses only python code. Non pure can cantain c/c++ code as well)

  • site-packages is by default part of the python search path, so modules installed there can be imported easily afterwards.

  • A very useful article: https://docs.python.org/2/install/


猜你喜欢

转载自blog.csdn.net/honk2012/article/details/80505262