【python】dist-packages和site-packages的区别
一、dist-packages和site-packages的區(qū)別
The 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 into this location:
/usr/lib/python2.7/dist-packagesSince?easy_install?and?pip?are installed from the package manager, they also use dist-packages, but they put packages here:
/usr/local/lib/python2.7/dist-packagesFrom the?Debian Python Wiki:
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.
This means that if you manually install Python from source, it uses the site-packages directory. This allows you to keep the two installations separate, especially since Debian and Ubuntu rely on the system version of Python for many system utilities.
?
?二、查看python的庫路徑
terminal進(jìn)入python命令行界面
>>>from distutils.sysconfig import get_python_lib >>>print(get_python_lib())?
轉(zhuǎn)載于:https://www.cnblogs.com/gdut-gordon/p/9336067.html
總結(jié)
以上是生活随笔為你收集整理的【python】dist-packages和site-packages的区别的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 图片下间隙问题
- 下一篇: C++ Linux下线程池的实现