天天看點

python的packages管理

一、概念介紹 

      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提供的包管理工具有多個,其關系如下:

       可以看出,distribute代替了setuptools, 但将來會被distutils2取代,并作為标準庫的一部分。

       關于packages的管理,則由pip進行

       distribute是對标準庫disutils子產品的增強,disutils主要是用來更加容易的打包和分發包,特别是對其他的包有依賴的包。

       distribute被建立是因為setuptools包不再維護了

       pip 是安裝python包的工具,提供了安裝包,列出已經安裝的包,更新包以及解除安裝包的功能。

       pip 是對easy_install的取代,提供了和easy_install相同的查找包的功能,是以可以使用easy_install安裝的包也同樣可以使用pip進行安裝

python的packages管理

二、distribute和pip的安裝

      1.安裝distribute       

      2.安裝pip(需要先安裝distribute)

三、如何使用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

四、pipe提供的指令截圖如下:

python的packages管理