程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

What‘s the difference between dist-packages and site-packages python

編輯:Python
dist-packages is a Debian-specific convention
that is also present in its derivatives, like Ubuntu.
Modules are installed to dist-packages when they come from the Debian package manager:
/usr/lib/python3/dist-packages
dist-packages instead of site-packages.
Third party Python software installed from Debian packages goes into dist-packages, not site-packages.
This is to reduce conflict
between the system Python,
and any from-source Python build you might install manually.
/usr/lib/python3/dist-packages
contains non-host-specific modules installed by the system with the package manager,
for example on Ubuntu with sudo apt-get install python-numpy.
/usr/local/lib/python3.8/dist-packages
contains modules that you installed yourself system-wide through a package manager,
for example with sudo pip install numpy.
/home/wk/.local/lib/python3.8/site-packages
contains modules that the user wk has installed in his own user directory, for example by using pip in user-mode.
Those modules can of cause only be imported by wk,
because they don't appear in other user's PATH variables
and might not even be readable by another user.

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved