【工具安裝】-CentOS-安裝python包管理工具pip

來源:互聯網
上載者:User

     pip是python的包管理工具,pip庫中內建了很多python的開源工具包,在使用的時候直接運行pip install就可以下載並安裝註冊到python模組內,下文將會討論centos中如何安裝pip。


一、安裝pip命令

    下載pip安裝包:

[root@web1 xxx]# wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz

    解壓tar包:

[root@web1 xxx]# tar -vxf setuptools-1.4.2.tar.gz

   進入解壓包,並運行安裝命令:

[root@web1 xxx]# cd setuptools-1.4.2[root@web1 xxx]# python2.7 setup.py install

   安裝完成後,最後安裝pip:

[root@web1 xxx]# easy_install-2.7 pip

   檢測是否已經安裝成功:

[root@web1 xxx]# pip --versionpip 1.2 from /usr/local/lib/python2.7/site-packages/pip-1.2-py2.7.egg (python 2.7)

二、pip常用命令

    1、查看pip使用協助:

[root@web1 xxx]# pip helpUsage: pip COMMAND [OPTIONS] --version                    show program's version number and                              exit -h, --help                   Show help -v, --verbose                Give more output -q, --quiet                  Give less output --log <FILENAME>             Log file where a complete (maximum                              verbosity) record will be kept --proxy <PROXY>              Specify a proxy in the form                              user:passwd@proxy.server:port. Note                              that the user:password@ is optional                              and required only if you are behind                              an authenticated proxy. If you                              provide user@proxy.server:port then                              you will be prompted for a                              password. --timeout <SECONDS>          Set the socket timeout (default 15                              seconds) --exists-action <EXISTS_ACTION>                              Default action when a path already                              exists. Use this option more than                              one time to specify another action                              if a certain option is not                              available. Choices: (s)witch,                              (i)gnore, (w)ipe, (b)ackupCommands available:  bundle: Create pybundles (archives containing multiple packages)  freeze: Output all currently installed packages (exact versions) to stdout  help: Show available commands  install: Install packages  search: Search PyPI  uninstall: Uninstall packages  unzip: Unzip individual packages  zip: Zip individual packages

   2、pip安裝python包

[root@web1 xxx]# pip install 安裝包名

  3、pip卸載已安裝的包

[root@web1 xxx]# pip uninstall 包名

  4、其它常用命令

freeze: 查看已經安裝的python包help: FAQ查看pip協助search: Search PyPIunzip: 解壓一個包zip: 壓縮一個已經安裝的包



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.