1、概念介绍 html
Python is known for it's “batteries included” philosophy and has a rich standard library。However, being a popular language, the number of third party packages is much larger than the number of standard library packages. So it eventually becomes necessary to discover how packages are used, found and created in Python. python
目前python提供的包管理工具备多个,其关系以下: ide
具体能够参见:http://guide.python-distribute.org/introduction.html 工具
能够看出,Distribute代替了Setuptools, 但未来会被distutils2取代,并做为标准库的一部分。 网站
关于packages的管理,则由pip进行 ui
有关packages的发布,查找的网站是:https://pypi.python.org/pypi spa
Distribute是对标准库disutils模块的加强,disutils主要是用来更加容易的打包和分发包,特别是对其余的包有依赖的包。 code
Distribute被建立是由于Setuptools包再也不维护了 htm
Pip 是安装python包的工具,提供了安装包,列出已经安装的包,升级包以及卸载包的功能。 ip
Pip 是对easy_install的取代,提供了和easy_install相同的查找包的功能,所以可使用easy_install安装的包也一样可使用pip进行安装
2、Distribute和pip的安装
1.安装Distribute
$ wget http://python-distribute.org/distribute_setup.py $ python distribute_setup.py
2.安装pip(须要先安装Distribute)
$ wget https://pypi.python.org/packages/source/p/pip/pip-1.5.2.tar.gz $ cd pip-1.5.2 $ python setup.py install
3、如何使用pip
1.列出安装的packages
pip list
若是按必定的格式列出,则使用
pip freeze
2. 查找packages
pip search crypto
3. 安装包
pip install crypto
4.更新包
pip install -U crypto
5.卸载包
pip uninstall crypto
4、pipe提供的命令截图以下: