python pip 是什么

Python (242) 2023-05-17 18:06:20

我们知道python中有着许多包的存在,那么在安装和管理的工具上,我们可以使用pip来完成。当然python安装包的工具有很多中类型,本篇着重于pip的讲解,下面我们就来一起看看它是如何对包进行管理的吧。

1、说明

pip是一个安装和管理Python包的工具,python安装包的工具有easy_install, setuptools, pip,distribute等。而pip是easy_install的替代品。pip作为包管理器。这意味着它是一个工具,允许你安装和管理不属于标准库的其他库和依赖。

2、使用

安装后在命令行中键入:pip+ 回车,就会出现如下使用说明:

Usage:
pip<command>[options]

Commands:
installInstallpackages.
downloadDownloadpackages.
uninstallUninstallpackages.
freezeOutputinstalledpackagesinrequirementsformat.
listListinstalledpackages.
showShowinformationaboutinstalledpackages.
checkVerifyinstalledpackageshavecompatibledependencies.
configManagelocalandglobalconfiguration.
searchSearchPyPIforpackages.
wheelBuildwheelsfromyourrequirements.
hashComputehashesofpackagearchives.
completionAhelpercommandusedforcommandcompletion.
helpShowhelpforcommands.

GeneralOptions:
-h,--helpShowhelp.
--isolatedRunpipinanisolatedmode,ignoringenvironmentvariablesanduserconfiguration.
-v,--verboseGivemoreoutput.Optionisadditive,andcanbeusedupto3times.
-V,--versionShowversionandexit.
-q,--quietGivelessoutput.Optionisadditive,andcanbeusedupto3times(correspondingto
WARNING,ERROR,andCRITICALlogginglevels).
--log<path>Pathtoaverboseappendinglog.
--proxy<proxy>Specifyaproxyintheform[user:passwd@]proxy.server:port.
--retries<retries>Maximumnumberofretrieseachconnectionshouldattempt(default5times).
--timeout<sec>Setthesockettimeout(default15seconds).
--exists-action<action>Defaultactionwhenapathalreadyexists:(s)witch,(i)gnore,(w)ipe,(b)ackup,
(a)bort).
--trusted-host<hostname>Markthishostastrusted,eventhoughitdoesnothavevalidoranyHTTPS.
--cert<path>PathtoalternateCAbundle.
--client-cert<path>PathtoSSLclientcertificate,asinglefilecontainingtheprivatekeyandthe
certificateinPEMformat.
--cache-dir<dir>Storethecachedatain<dir>.
--no-cache-dirDisablethecache.
--disable-pip-version-check
Don'tperiodicallycheckPyPItodeterminewhetheranewversionofpipisavailablefor
download.Impliedwith--no-index.
--no-colorSuppresscoloredoutput

以上就是python pip的内容分享,相信大家已经知道pip命令的使用了,希望对初学python的人有所帮助。更多Python学习推荐:PyThon学习网教学中心

(推荐操作系统:windows7系统、Python 3.9.1,DELL G3电脑。)

THE END

发表回复