Python 包管理工具

python 包管理工具

setuptools
管理第三方包,将其安装到site-package 下。安装的包后缀一般为.egg,实际是zip格式。
命令:easy_install

wheel
安装包的后缀是.whl,其实也是zip格式。  它的出现是为了替代egg。相关标准参见PEP 427(http://www.python.org/dev/peps/pep-0427)
用法:
wheel install .whl文件

有时会报错如下
ValueError: Wheel file pymssql-2.1.2.dist-info/RECORD would overwrite f:\program
files\python27\Lib\site-packages\pymssql-2.1.2.dist-info\RECORD. Use force if t
his is intended

pip
python第三方包管理的事实标准。是推荐使用的包管理工具。
用法:
pip install pyodbc

相关配置:
确保有如下文件,否则新建。
C:\Users\{用户名}\pip\pip.ini    本人用的win8系统
该文件内容
[global]
index-url=http://pypi.douban.com/simple
trusted-host=pypi.douban.com
disable-pip-version-check=True
timeout=20

猜你喜欢

转载自foreach4.iteye.com/blog/2289787