溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Linux系統(tǒng)如何安裝pip

發(fā)布時(shí)間:2022-01-24 10:32:38 來源:億速云 閱讀:451 作者:小新 欄目:開發(fā)技術(shù)

小編給大家分享一下Linux系統(tǒng)如何安裝pip,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

pip簡介:

pip 是一個(gè)現(xiàn)代的,通用的 Python 包管理工具。提供了對(duì) Python 包的查找、下載、安裝、卸載的功能。

Linux系統(tǒng)安裝pip詳細(xì)步驟:

1.1 pip下載

 # wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate

1.2 pip安裝

 # tar -xzvf pip-1.5.4.tar.gz``# cd pip-1.5.4``# python setup.py install

二、pip使用詳解

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升級(jí)軟件

 # 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

三、pip使用實(shí)例

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``.....省略一些內(nèi)容....``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)

四、常見錯(cuò)誤

4.1 ImportError No module named setuptools

請(qǐng)參考《ImportError No module named setuptools解決

五、pip參數(shù)解釋

 # pip --help
 
 Usage:
  pip[options]
 
 Commands:
  install   安裝軟件.
  uninstall   卸載軟件.
  freeze   按著一定格式輸出已安裝軟件列表
  list   列出已安裝軟件.
  show   顯示軟件詳細(xì)信息.
  search   搜索軟件,類似yum里的search.
  wheel   Build wheels from your requirements.
  zip    不推薦. Zip individual packages.
  unzip   不推薦. Unzip individual packages.
  bundle   不推薦. Create pybundles.
  help   當(dāng)前幫助.
 
 General Options:
  -h, --help   顯示幫助.
  -v, --verbose  更多的輸出,最多可以使用3次
  -V, --version  現(xiàn)實(shí)版本信息然后退出.
  -q, --quiet   最少的輸出.
  --log-file 覆蓋的方式記錄verbose錯(cuò)誤日志,默認(rèn)文件:/root/.pip/pip.log
  --log 不覆蓋記錄verbose輸出的日志.
  --proxy Specify a proxy in the form [user:passwd@]proxy.server:port.
  --timeout 連接超時(shí)時(shí)間 (默認(rèn)15秒).
  --exists-action  Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.
  --cert 證書.

以上是“Linux系統(tǒng)如何安裝pip”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI