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

     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 --version
pip 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 help
Usage: 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)ackup

Commands 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 PyPI
unzip: 解压一个包
zip: 压缩一个已经安装的包



  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值