【python】dist-packages和site-packages的区别
一、dist-packages和site-packages的区别
- sudo apt-get install 安装的package存放在/usr/lib/python2./dist-packages目录中
- pip 或者 easy_install安装的package存放在/usr/local/lib/python2./dist-packages目录中
- 手动从源代码安装的package存放在site-packages目录中
- 自己手动升级或安装的python,通过pip或者easy_install安装的package存放在/usr/local/lib/python2./site-packages 目录中
- 非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的区别的更多相关文章
- Python 安装路径, dist-packages 和 site-packages 区别
Stack Overflow's answer 译: dist-packages is a Debian-specific convention that is also present in its ...
- python _、__和__xx__的区别
python _.__和__xx__的区别 本文为译文,版权属于原作者,在此翻译为中文分享给大家.英文原文地址:Difference between _, __ and __xx__ in Pytho ...
- python中import和from...import...的区别
python中import和from...import...的区别: 只用import时,如import xx,引入的xx是模块名,而不是模块内具体的类.函数.变量等成员,使用该模块的成员时需写成xx ...
- 转发 python中file和open有什么区别
python中file和open有什么区别?2008-04-15 11:30地痞小流氓 | 分类:python | 浏览3426次python中file和open有什么区别?都是打开文件,说的越详细越 ...
- Python新式类与经典类的区别
1.新式类与经典类 在Python 2及以前的版本中,由任意内置类型派生出的类(只要一个内置类型位于类树的某个位置),都属于“新式类”,都会获得所有“新式类”的特性:反之,即不由任意内置类型派生出的类 ...
- Python import与from import使用及区别介绍
Python程序可以调用一组基本的函数(即内建函数),比如print().input()和len()等函数.接下来通过本文给大家介绍Python import与from import使用及区别介绍,感 ...
- 【转】python类中super()和__init__()的区别
[转]python类中super()和__init__()的区别 单继承时super()和__init__()实现的功能是类似的 class Base(object): def __init__(se ...
- Python新式类和经典类的区别
@Python新式类和经典类的区别 class ClassicClass(): pass class NewStyleClass(object): pass x1 = ClassicClass() x ...
- Python3.x:python: extend (扩展) 与 append (追加) 的区别
Python3.x:python: extend (扩展) 与 append (追加) 的区别 1,区别: append() 方法向列表的尾部添加一个新的元素.只接受一个参数: extend()方法只 ...
- Python中str()与repr()函数的区别——repr() 的输出追求明确性,除了对象内容,还需要展示出对象的数据类型信息,适合开发和调试阶段使用
Python中str()与repr()函数的区别 from:https://www.jianshu.com/p/2a41315ca47e 在 Python 中要将某一类型的变量或者常量转换为字符串对象 ...
随机推荐
- 一段曾经处理datetime的代码
前记:主要是数据库存储记录时一个属性是以"2019-01"这样的年月进行存储的,当需要根据A年月到B年月取出相关记录时,filter()直接range()是不行的,不是数值区间或者 ...
- URI和URL之间的区别
URI的全称为统一资源标识符(Uniform Resource Identifier),是一个用于标识某一互联网资源名称的字符串. 该种标识允许用户对任何(包括本地和互联网)的资源通过特定的协议进行交 ...
- MVC实战之排球计分软件(深入了解面向对象编程)
在此篇博客之前,我已经写了一个实战系列的博客,虽然不太成熟但是相对比较实用,在这篇博客我将继续使用mvc编程此软件. 此篇博客会在一定的时间内完成,此次完成的软件的一个需求是提供给运动员的使用.我将在 ...
- ThinkPHP5.0源码学习之执行应用
一.应用启动 在/thinkphp/start.php文件中,用一句代码App::run()->send();实现应用的启动. // 执行应用 App::run()->send(); ...
- node 安装 vue-cli 创建vue项目
$ npm install -g vue-cli $ vue init webpack-simple my-project $ cd my-project $ npm install $ npm ru ...
- fiddler抓取用tomcat来部署的项目接口请求包
Fiddler 是以代理web服务器的形式工作的,它使用代理地址:127.0.0.1,端口:8888. 当Fiddler退出的时候它会自动注销, 这样就不会影响别的程序.关于fiddler这个工具的使 ...
- iPhone手机更换自定义铃声
①首先将iPhone手机(iPhone5s)的数据线插入电脑USB接口中,然后打开iTunes(12.4.3.1)-->文件-->将文件添加到资料库 ②选中音乐文件-->点击编辑-- ...
- python if __name__=='__main__'的理解
定义一个模块叫module.py: def main(): print "we are in %s" %__name__ if __name__=='__main__': main ...
- 初始C#(二)
一 数组 定义:能存放任意多个同类型数据 声明与赋值:声明:数据类型[ ]变量名 赋值:变量名=new 数据类型[长度] ...
- angular2 pipe实现搜索结果中的搜索关键字高亮
效果图如下 1.声明一个pipe import {Pipe, Injectable, PipeTransform} from '@angular/core';import { DomSanitizer ...