一、dist-packages和site-packages的区别

  1. sudo apt-get install 安装的package存放在/usr/lib/python2./dist-packages目录中
  2. pip 或者 easy_install安装的package存放在/usr/local/lib/python2./dist-packages目录中
  3. 手动从源代码安装的package存放在site-packages目录中
  4. 自己手动升级或安装的python,通过pip或者easy_install安装的package存放在/usr/local/lib/python2./site-packages 目录中
  5. 非root用户,通过pip或者easy_install安装的package存放在~/.local/lib/python2./site-packages

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./dist-packages

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

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

From 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进入python命令行界面

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

【python】dist-packages和site-packages的区别的更多相关文章

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

    Stack Overflow's answer 译: dist-packages is a Debian-specific convention that is also present in its ...

  2. python _、__和__xx__的区别

    python _.__和__xx__的区别 本文为译文,版权属于原作者,在此翻译为中文分享给大家.英文原文地址:Difference between _, __ and __xx__ in Pytho ...

  3. python中import和from...import...的区别

    python中import和from...import...的区别: 只用import时,如import xx,引入的xx是模块名,而不是模块内具体的类.函数.变量等成员,使用该模块的成员时需写成xx ...

  4. 转发 python中file和open有什么区别

    python中file和open有什么区别?2008-04-15 11:30地痞小流氓 | 分类:python | 浏览3426次python中file和open有什么区别?都是打开文件,说的越详细越 ...

  5. Python新式类与经典类的区别

    1.新式类与经典类 在Python 2及以前的版本中,由任意内置类型派生出的类(只要一个内置类型位于类树的某个位置),都属于“新式类”,都会获得所有“新式类”的特性:反之,即不由任意内置类型派生出的类 ...

  6. Python import与from import使用及区别介绍

    Python程序可以调用一组基本的函数(即内建函数),比如print().input()和len()等函数.接下来通过本文给大家介绍Python import与from import使用及区别介绍,感 ...

  7. 【转】python类中super()和__init__()的区别

    [转]python类中super()和__init__()的区别 单继承时super()和__init__()实现的功能是类似的 class Base(object): def __init__(se ...

  8. Python新式类和经典类的区别

    @Python新式类和经典类的区别 class ClassicClass(): pass class NewStyleClass(object): pass x1 = ClassicClass() x ...

  9. Python3.x:python: extend (扩展) 与 append (追加) 的区别

    Python3.x:python: extend (扩展) 与 append (追加) 的区别 1,区别: append() 方法向列表的尾部添加一个新的元素.只接受一个参数: extend()方法只 ...

  10. Python中str()与repr()函数的区别——repr() 的输出追求明确性,除了对象内容,还需要展示出对象的数据类型信息,适合开发和调试阶段使用

    Python中str()与repr()函数的区别 from:https://www.jianshu.com/p/2a41315ca47e 在 Python 中要将某一类型的变量或者常量转换为字符串对象 ...

随机推荐

  1. Petrozavodsk Winter Camp, Andrew, 2014, Dichromatic Trees

    条件: 1:每个红色节点的儿子都是黑色节点 2.每个叶子到根路径上的黑点数相等,等于某个常数,称作树的black height 求给定black height和节点数的符合条件的方案数 $black_ ...

  2. JS中使用时间戳,获取当前日期,计算前一周的日期~

    今天项目中用到了一点 随便记录一下 function timestampToTime(timestamp) { );//时间戳为10位需*1000,时间戳为13位的话不需乘1000 var Y = d ...

  3. 理解TCP序列号(Sequence Number)和确认号(Acknowledgment Number)

    原文见:http://packetlife.net/blog/2010/jun/7/understanding-tcp-sequence-acknowledgment-numbers/ from:ht ...

  4. node.js面试题大全-侧重后端应用与对Node核心的理解

    Node是搞后端的,不应该被被归为前端,更不应该用前端的观点去理解,去面试node开发人员.所以这份面试题大全,更侧重后端应用与对Node核心的理解. github地址: https://github ...

  5. 最全的测试用例(UI)

    一.文本框为字符型 必填项非空校验:      1.必填项未输入--程序应提示错误:      2.必填项只输入若干个空格,未输入其它字符--程序应提示错误: 字段唯一性校验:(不是所有字段都作此项校 ...

  6. Python 3.6.5 导入pymysql模块出错:No module named 'pymysql'

    检查一下项目设置中的解释器. 查看是否添加PyMySQL模块,如果没有请添加PyMySQL模块

  7. NAT资料

    第1章 NAT 1.1 NAT概述 1990年代中期,NAT是作为一种解决IPv4地址短缺以避免保留IP地址困难的方案而流行起来的.网络地址转换在很多国家都有很广泛的使用.所以NAT就成了家庭和小型办 ...

  8. scrapy的Middleware

    对于下载中间件 settings里的数字大小: process_request的顺序 数字越小,越先调用 process_response 的顺序, 数字越大,越先调用 返回值: process_re ...

  9. ui学习心得

    软工课上我分配的任务是界面设计,但是对于初期一个ps从没接触的人来说我觉得还是有点困难,所以要从头学起.  PS的功能是什么呢?对于业余爱好者来说,主要还是做一些简单的处理照片.绘图.设计一些皮肤等, ...

  10. be动词的形式和用法

    Be动词的形式: be, is, am, are, was, were, being, been 1.The man is back 2.They are back 3.He was back 4.T ...