【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中使用Thread线程与AsyncTask异步任务的区别
最近和几个朋友交流Android开发中的网络下载问题时,谈到了用Thread开启下载线程时会产生的Bug,其实直接用子线程开启下载任务的确是很Low的做法,那么原因究竟如何,而比较高大上的做法是怎样? ...
- 4、NFS
一.NFS简介 4.1.1:什么是NFS NFS(Network File System,网络文件系统)是由SUN公司开发,并于1984年推出的技术,通过使用NF,用户和程序可以向访问本地文件一样访问 ...
- 2015-10-13 jQuery5实例
jQuery(5) 一.扑克牌切换 <body> <div class="ig ig1"><img src="image/1.jpg&q ...
- JDBC数据库连接工具
什么是JDBC? JDBC是一种可以执行sql语句的Java API,提供对数据库的访问方法. 什么是JDBC驱动? JDBC连接数据库需要驱动,驱动是两个设备要进行通信,满足一定的数据驱动格式.一般 ...
- linux快捷键 常用快捷键
常用的快捷键 'ctrl+c' 强制终止当前命令 'ctrl+l' 清屏 'ctrl+a' 光标移动到命令行首 'ctrl+e' 光标移动到命令行尾 'ctrl+u' 从光标所在的位置删除到行首 'c ...
- spoj Minimax Triangulation
题解: dp+计算几何 F[i][j]表示第i-j条边的答案 然后转移一下 代码: #include<bits/stdc++.h> using namespace std; ]; ][]; ...
- 2.3 利用FTP服务器下载和上传文件
二.利用FTP服务器的下载文件 from ftplib import FTP from os.path import exists def getfile(file,site,dir,user=(), ...
- RN环境的搭建
RN技术详细了解: RN环境的搭建: 1. 首先安装node.js 2. 安装homebrew(网上内容很多自己找,详细的我就不多说了) (1) 在home ...
- ubuntu1604使用之旅——启动ssh系列
---恢复内容开始--- 1.安装ssh的client和server: sudo apt-get install openssh-server openssh-client 2.然后就要安装key: ...
- Full permutation
Full Permutation 全排列问题, 将1~n这n个整数按字典序排放 划分: 输出1开头的全排列 输出2开头的全排列 ...... 输出n开头的全排列 递归边界:当下标1 ~ n 位都已经填 ...