pip 安裝使用詳解

2021-07-09 12:55:30 字數 1710 閱讀 8899

pip類似redhat裡面的yum,安裝python包非常方便。本節詳細介紹pip的安裝、以及使用方法。

# wget "" --no-check-certificate

1.2 pip安裝

# tar -xzvf pip-1.5.4.tar.gz

# cd pip-1.5.4

# python setup.py install

2.1 pip安裝包

# pip install somepackage

[...]

successfully installed somepackage

2.2 pip檢視已安裝的包

# pip show --files somepackage

name: somepackage

version: 1.0

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

files:

../somepackage/__init__.py

[...]

2.3 pip檢查哪些包需要更新

# pip list --outdated

somepackage (current: 1.0 latest: 2.0)

2.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

2.5 pip解除安裝包

$ pip uninstall somepackage

uninstalling somepackage:

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

proceed (y/n)? y

successfully uninstalled somepackage

3.1 安裝redis

# pip install redis

3.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

3.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)

4.1 importerror no module named setuptools

請參考《importerror no module named setuptools解決》

安裝使用一目了然。

pip安裝使用詳解

pip類似centos裡面的yum,安裝python包非常方便。本節詳細介紹pip的安裝 以及使用方法。windows安裝 windows版本在2.7.9及以上版本才提供的有pip的安裝,安裝python的時候缺省會安裝pip,但是需要選中add python.ext to path,這個安裝成功後...

pip安裝使用詳解

pip類似redhat裡面的yum,安裝python包非常方便。本節詳細介紹pip的安裝 以及使用方法。wget no check certificate wget no check certificate 1.2 pip安裝 tar xzvf pip 1.5.4.tar.gz cd pip 1.5...

pip安裝使用詳解

1 wget no check certificate 1.2 pip安裝 tar xzvf pip 1.5.4.tar.gz cd pip 1.5.4 python setup.py install 2.pip使用詳解 2.1 pip安裝包 pip install somepackage succ...