linux下pip的安裝步驟及使用詳解
前言
pip類似RedHat里面的yum,安裝軟件非常方便。本節(jié)詳細(xì)介紹pip的安裝、以及使用方法,希望文章對(duì)各位了解pip的安裝與使用帶來(lái)幫助。下面話不多說(shuō),來(lái)看看詳細(xì)的介紹:
一、pip下載安裝
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)
四、常見(jiàn)錯(cuò)誤
4.1 ImportError No module named setuptools
請(qǐng)參考《ImportError No module named setuptools解決》
五、pip參數(shù)解釋
# pip --help Usage: pip <command> [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 <path> 覆蓋的方式記錄verbose錯(cuò)誤日志,默認(rèn)文件:/root/.pip/pip.log --log <path> 不覆蓋記錄verbose輸出的日志. --proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port. --timeout <sec> 連接超時(shí)時(shí)間 (默認(rèn)15秒). --exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup. --cert <path> 證書.
總結(jié)
安裝使用一目了然,太簡(jiǎn)單了。老板再也不要我安裝軟件了。
好了,以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,如果有疑問(wèn)大家可以留言交流,謝謝大家對(duì)腳本之家的支持。
相關(guān)文章
Linux常用命令之chmod修改文件權(quán)限777和754
這篇文章主要介紹了Linux常用命令之chmod修改文件權(quán)限777和754,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09
Keepass+PuTTYPortable+Winscp一鍵登錄實(shí)例詳解
這篇文章主要介紹了Keepass+PuTTYPortable+Winscp一鍵登錄實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下2017-01-01
Linux系統(tǒng)為什么要吃掉我的“內(nèi)存”
這篇文章主要介紹了Linux系統(tǒng)為什么要吃掉我的“內(nèi)存”的相關(guān)資料,需要的朋友可以參考下2019-07-07
CentOS7如何執(zhí)行PHP定時(shí)任務(wù)詳解
這篇文章主要給大家介紹了關(guān)于在CentOS7中如何執(zhí)行PHP定時(shí)任務(wù)的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2018-11-11

