Python pip 常用命令匯總
使用了這么就pip命令,但是一直是簡(jiǎn)單使用,很多命令都是用了查,查了用,今天把常用的命令匯總一下,方便使用。
命令:
pip

由上圖可以看到 pip 支持一下命令
Commands: install Install packages. download Download packages. uninstall Uninstall packages. freeze Output installed packages in requirements format. list List installed packages. show Show information about installed packages. check Verify installed packages have compatible dependencies. search Search PyPI for packages. wheel Build wheels from your requirements. hash Compute hashes of package archives. completion A helper command used for command completion. help Show help for commands.
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring
environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be
used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be
used up to 3 times (corresponding to WARNING,
ERROR, and CRITICAL logging levels).
--log <path> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form
[user:passwd@]proxy.server:port.
--retries <retries> Maximum number of retries each connection should
attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists:
(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host as trusted, even though it does
not have valid or any HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file
containing the private key and the certificate
in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
1、install
pip install You must give at least one requirement to install (see "pip help install")

所以這里可以直接使用一下命令實(shí)現(xiàn)在線安裝
pip install <包名> 或 pip install -r requirements.txt
通過(guò)使用== >= <= > <來(lái)指定版本,不寫則安裝最新版 requirements.txt內(nèi)容格式為: APScheduler==2.1.2 Django==1.5.4 MySQL-Connector-Python==2.0.1 MySQL-python==1.2.3 PIL==1.1.7 South==1.0.2 django-grappelli==2.6.3 django-pagination==1.0.7
安裝本地安裝包
pip install <目錄>/<文件名> 或 pip install --use-wheel --no-index --find-links=wheelhouse/ <包名>
2、uninstall
卸載安裝包
pip uninstall <包名> 或 pip uninstall -r requirements.txt
升級(jí)包
pip install -U <包名> 或:pip install <包名> --upgrade
升級(jí)pip
pip install -U pip
或
使用pip安裝插件的時(shí)候報(bào)錯(cuò): You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. 升級(jí)命令: python -m pip install --upgrade pip
3、freeze
pip freeze,查看已經(jīng)安裝的包及版本信息。

導(dǎo)出到指定文件中,如圖,注意 “ > ”,文件名稱隨意。常見按第二種寫法。

4、list

查詢可升級(jí)的包
pip list -o

5、show
顯示包所在目錄及信息

6、search
搜索包
pip search <搜索關(guān)鍵字>
以上就是Python pip 常用命令匯總的詳細(xì)內(nèi)容,更多關(guān)于Python pip 常用命令的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
python switch 實(shí)現(xiàn)多分支選擇功能
這篇文章主要介紹了python switch 實(shí)現(xiàn)多分支選擇功能,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-12-12
Python Pygame實(shí)現(xiàn)兔子獵人守護(hù)城堡游戲
這篇文章主要介紹了用python來(lái)制作的一個(gè)守護(hù)類小游戲兔子獵人守護(hù)城堡,文中的示例代碼介紹得很詳細(xì),感興趣的小伙伴快來(lái)跟隨小編一起學(xué)習(xí)學(xué)習(xí)吧2021-12-12
Python使用Pandas讀寫Excel實(shí)例解析
這篇文章主要介紹了Python使用Pandas讀寫Excel實(shí)例解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-11-11
python實(shí)現(xiàn)圖片變亮或者變暗的方法
這篇文章主要介紹了python實(shí)現(xiàn)圖片變亮或者變暗的方法,涉及Python中Image模塊操作圖片的相關(guān)技巧,需要的朋友可以參考下2015-06-06
利用Python實(shí)現(xiàn)文件讀取與輸入以及數(shù)據(jù)存儲(chǔ)與讀取的常用命令
這篇文章主要給大家介紹了關(guān)于利用Python實(shí)現(xiàn)文件讀取與輸入以及數(shù)據(jù)存儲(chǔ)與讀取的常用命令,文中還介紹了用python循環(huán)保存文件并循環(huán)讀取文件的方法,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-11-11
python實(shí)現(xiàn)AdaBoost算法的示例
這篇文章主要介紹了python實(shí)現(xiàn)AdaBoost算法的示例,幫助大家更好的理解和了解機(jī)器學(xué)習(xí)算法,感興趣的朋友可以了解下2020-10-10
pytest實(shí)現(xiàn)測(cè)試用例參數(shù)化
這篇文章主要介紹了pytest實(shí)現(xiàn)測(cè)試用例參數(shù)化,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2021-04-04

