原文地址:http://www.ttlsa.com/python/how-to-install-and-use-pip-ttlsa/
1.1 pip安裝包
| # pip install SomePackage [...] Successfully installed SomePackage |
1.2 pip查看已安裝的包
|
#
pip show --files SomePackage
Name:
SomePackage
Version:
1.0
Location:
/my/env/lib/pythonx.x/site-packages
Files:
../somepackage/__init__.py
[...]
|
1.3 pip檢查哪些包需要更新
| # pip list --outdated SomePackage (Current: 1.0 Latest: 2.0) |
1.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
|
1.5 pip卸載包
| $ pip uninstall SomePackage Uninstalling SomePackage: /my/env/lib/pythonx.x/site-packages/somepackage Proceed (y/n)? y Successfully uninstalled SomePackage |
2. pip使用實例
2.1 安裝redis
2.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 |
2.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)
|