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())

Python 安装路径, dist-packages 和 site-packages 区别的更多相关文章

  1. mac下Python安装路径的说明

    Python安装路径的说明 mac在安装Python时, 对不同的安装方式 不同的型号均会安装在不同的文件夹下 安装方式 路径 系统默认(2.7) /System/Library/Frameworks ...

  2. 查看Python安装路径

    由于笔者自己经常忘记了如何查看Python的安装路径,又经常会用到Python的安装路径,因此记录一下,我们可以在命令行模式下输入: >>> import sys >>& ...

  3. Mac查看Python安装路径和版本

    目录 #查看当前所有Python版本路径 appledeMBP:~ apple$ which python2.7 /usr/local/bin/python2.7 appledeMBP:~ apple ...

  4. linux查看python安装路径,版本号

    一.想要查看ubuntu中安装的Python路径 方法一:whereis python 方法二:which python 二.想要查看ubuntu中安装的python版本号 python

  5. 安装PIL库时提示python未注册错误(自定义python安装路径)

    import sys from _winreg import * # tweak as necessary version = sys.version[:3] installpath = sys.pr ...

  6. linux 查看python安装路径,版本号

    一.想要查看ubuntu中安装的python路径 方法一:whereis python     方法二:which python   二.想要查看ubuntu中安装的python版本号 python ...

  7. mac 查看python安装路径

    1.terminal : input: which Python 2.terminal: input : python  --->import sys  ----> print sys.p ...

  8. MAC中查看Python安装路径

    [admin@admindeMac:~]which  Python /usr/bin/Python

  9. mac查看python安装路径

    1.terminal : input: which Python 或者 which Python3 2.terminal: input : python  --->import sys  --- ...

随机推荐

  1. Python单例模式的4种实现方法

    #-*- encoding=utf-8 -*- print '----------------------方法1--------------------------' #方法1,实现__new__方法 ...

  2. python学习菜单

    一.python简介 二.python字符串 三.列表 四.集合.元组.字典 五.函数 六.python 模块 七.python 高阶函数 八.python 装饰器 九.python 迭代器与生成器  ...

  3. 给iOS开发新手送点福利,简述UIDatePicker的用法

    1.Locale 设置DatePicker的地区,即设置DatePicker显示的语言. 1.跟踪所有可用的地区,取出想要的地区 NSLog(@"%@", [NSLocale av ...

  4. 大数据量表中,增加一个NOT NULL的新列

      这次,发布清洗列表功能,需要对数据库进行升级.MailingList表加个IfCleaning字段,所有的t_User*表加个IfCleaned字段.   脚本如下 对所有的t_User表执行 a ...

  5. JS监听浏览器事件

    Onunload与Onbeforeunload Onunload,onbeforeunload都是在刷新或关闭时调用,可以在<script>脚本中通过window.onunload来指定或 ...

  6. 解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办

    解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办 问题是出现在了PHP.INI上面了 ,原 ...

  7. Win10交换Ctrl和大写键

    打开注册表 [HKEY_LOCAL_MacHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] "Scancode Map" ...

  8. jpa-入门测试

    package com.atguigu.jpa.test; import java.util.Date;import java.util.List; import javax.persistence. ...

  9. iTunes 错误 -50

    iTunes,给苹果安装软件,这个软件的体验这么差!!! 手机上基本打不开AppStore,用电脑iTunes,经常莫名其妙的错误代码冒出. 速度奇慢无比. error -50 打开iTunes -- ...

  10. delphi c++builder JSON 生成与解析 例子

    json,System.JSON,REST.JSON JSON有两种数据结构,对象和数组. 对象在js中表示为“{}”括起来的内容,数据结构为 {key:value,key:value,...} 数组 ...