Home > Article > Backend Development > Where is the python third-party library installed?
Simply put
If it is the python that comes with the system, the dist-packages directory will be used;
If you install python manually, it will use the directory directly site-packages.
This allows you to keep the two installations isolated.
dist-packages: python that comes with the system
site-packages: python installed by yourself
The installation path of the Python package is as follows
1. The system comes with python
The system comes with a software manager for installation. The module will Installed into dist-packages
Related recommendations: "python video tutorial"
/usr/lib/python2.7/dist-packages/
From easy_install and pip (Note: It is the software manager of python, python has many Many software), they also use dist-packages, but the path is:
/usr/local/lib/python2.7/dist-packages/
2. Install it yourself or upgrade python
python to install a third party The path of the library is:
/usr/lib/python2.7/site-packages/
The installation path of the third-party library installed from easy_install and pip is:
/usr/local/lib/python2.7/site-packages/
3. For non-root users, install the third-party library from easy_install and pip. The installation path is
~/.local/lib/python2.7/site-packages
Sometimes you need to check whether the path of the third-party library is there (the author encountered a pit here. There is a certain library under the normal path, but the import cannot be found and can only point to The corresponding library here)
~/.local/lib/python2.7/site-packages/external/protobuf/python
The above is the detailed content of Where is the python third-party library installed?. For more information, please follow other related articles on the PHP Chinese website!