linux pip的安装路径,pip使用详解(包括pip install安装路径)

1、pip安装包

# pip install SomePackage

2、pip查看已安装的包(包括安装路径等详细信息)

# pip show --files SomePackage

Name:SomePackage

Version:1.0

Location:/my/env/lib/pythonx.x/site-packages

Files:

../somepackage/__init__.py

[...]

3 pip检查哪些包需要更新

# pip list --outdated

SomePackage (Current: 1.0 Latest: 2.0)

4 pip升级包

# pip install --upgrade SomePackage

[...]

Found existing installation: SomePackage 1.0

Uninstalling SomePackage:

Successfully uninstalled SomePackage

Running setup.py install for SomePackage

Successfully installed SomePackage

5 pip卸载包

$ pip uninstall SomePackage

Uninstalling SomePackage:

/my/env/lib/pythonx.x/site-packages/somepackage

Proceed (y/n)? y

Successfully uninstalled SomePackage

6. pip使用实例

6.1 安装redis

# pip install redis

6.2 卸载redis

# pip uninstall redis

Uninstalling redis:

/usr/lib/python2.6/site-packages/redis-2.9.1-py2.6.egg-info

.....省略一些内容....

Proceed (y/n)? y

Successfully uninstalled redis

6.3 查看待更新包

pip list --outdate

pygpgme (Current: 0.1 Latest: 0.3)

pycurl (Current: 7.19.0 Latest: 7.19.3.1)

iniparse (Current: 0.3.1 Latest: 0.4)

7. pip参数解释

# pip --help

Usage:

pip [options]

Commands:

install                     安装包.

uninstall                   卸载包.

freeze                      按着一定格式输出已安装包列表

list                        列出已安装包.

show                        显示包详细信息.

search                      搜索包,类似yum里的search.

wheel                       Build wheels from your requirements.

zip                         不推荐. Zip individual packages.

unzip                       不推荐. Unzip individual packages.

bundle                      不推荐. Create pybundles.

help                        当前帮助.

General Options:

-h, --help                  显示帮助.

-v, --verbose               更多的输出,最多可以使用3次

-V, --version               现实版本信息然后退出.

-q, --quiet                 最少的输出.

--log-file            覆盖的方式记录verbose错误日志,默认文件:/root/.pip/pip.log

--log                 不覆盖记录verbose输出的日志.

--proxy              Specify a proxy in the form [user:passwd@]proxy.server:port.

--timeout              连接超时时间 (默认15秒).

--exists-action     Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.

--cert                证书.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值