【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 中要将某一类型的变量或者常量转换为字符串对象 ...
随机推荐
- 启动欢迎页面时,Android Studio设置全屏Activity
问题 如何在Android Studio中做一个全屏的启动界面(Splash Activity)? 背景(基本是废话,没兴趣的请跳过) 前段时间把IED换成Android Studio2.2之后,碰到 ...
- ceph crush的问题
ceph crush的问题看一遍忘一遍,现将<ceph源码分析>一书中相关章节摘抄如下: 4.2.1 层级化的Cluster Map例4-1 Cluster Map定义层级化的Cluste ...
- STL 小白学习(3) vector
#include <iostream> using namespace std; #include <vector> void printVector(vector<in ...
- Java程序员从阿里拿到offer回来,这些面试题你会吗?
前不久刚从阿里面试回来,为了这场面试可以说准备了一个半月,做的准备就是刷题和看视频看书充实自己的技术,话说是真难啊,不过还算顺利拿到了offer,有很多面试题我已经记不起来了,这些是当天回家整理好的, ...
- C# 语句中的各种单例模式代码
1.非线程安全(经典模式),但没有考虑线程安全,在多线程时可能会出问题,不过还从没看过出错的现象. /// <summary> /// 单例模式的实现 /// </summary&g ...
- 管理商品demo
1.写一个管理商品的程序# 1.商品存在文件里面# 2.添加商品的时候,商品存在的就不能添加了,数量只能是大于0的整数,价格可以是小数.整数,但是只能是大于0的# 商品名称# 商品价格# 商品数量# ...
- C++ allocator
C++ allocator http://www.cnblogs.com/wpcockroach/archive/2012/05/10/2493564.html 说一说C++里的allocator.我 ...
- CentOS7 linux下yum安装mysql5.7
文章参考(https://www.cnblogs.com/jorzy/p/8455519.html) 1.创建存放安装包的位置,并且进入该目录 命令mkdir /share 命令cd /share 2 ...
- Jsの练习-数组常用方法 -splice()
splice() 功能:1.可以实现删除,插入和替换. 删除:可以删除任意数量的项,只需指定2个参数:要删除的第一项的位置和要删除的项数. 例如:splice(0,2)会删除数组中的前2项. 插入:可 ...
- error: checker javascript/jshint: can’t parse version string (abnormal termination?)”
vim 安装插件(k-vim方法 )好后 编辑js文件提示错误 可能是nodejs环境没搭建好 或者版本有误 用nvm安装node 后 需要 source ~/.bashrc 或者重新开一个终端 再运 ...