Python 安装路径, dist-packages 和 site-packages 区别

   

Stack Overflow's answer

 

译:

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:

dist-packages 是 Debian特定惯例,这也存在于像是ubuntu上。 如果使用Debian软件管理器安装, 模块将被安装到 dist-packages:

/usr/lib/python2.7/dist-packages

Since easy_install and pip are installed from the package manager, they also use dist-packages, but they put packages here:

自从 easy_install 和 pip (注: 是python的软件管理其,python有许许多多的软件) 使用,他们也使用 dist-packages,但是 路径是:

/usr/local/lib/python2.7/dist-packages

From the Debian Python Wiki:

从  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.

dist-packages取代了site-packages。从Debian安装包安装的第三方的Python软件 被 安装到 dist-packages,不是 site-packages.这是为了减少,系统自带python 和 你手动安装的python 之间的冲突。

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,它会直接使用目录site-packages。这允许你让两个安装隔离开来,特别是因为Debian 和 Ubuntu 应用 python的系统版本 到 许多的系统实体。

 

查找Python 安装路径THIS

>>> from distutils.sysconfig import get_python_lib
>>> print(get_python_lib())

 

 

转载于:https://www.cnblogs.com/kevin922/p/3161411.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值