作者:佚名 时间:2024-01-05 12:18:50 阅读:(25)
最近在学习Python的时候,发现模块的安装基本都是用pip来进行的接下来,云梦编程将为大家分享常用pip命令的用法,有需要的朋友可以参考一下:
pip是Python包管理工具,该工具提供了对Python包的查找、下载、安装、卸载的功能。
pip[options]
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. config Manage local and global configuration. 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. debug Show information useful for debugging. 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 to a verbose appending log. --proxy Specify a proxy in the form [user:passwd@]proxy.server:port. --retries Maximum number of retries each connection should attempt (default 5 times). --timeout Set the socket timeout (default 15 seconds). --exists-action Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort. --trusted-host Mark this host or host:port pair as trusted, even though it does not have valid or any HTTPS. --cert Path to alternate CA bundle. --client-cert Path to SSL client certificate, a single file containing the private key and the certificate in PEM format. --cache-dir Store the cache data in . --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. --no-color Suppress colored output --no-python-version-warning Silence deprecation warnings for upcoming unsupported Pythons.
(1)、版本查看:
pip -V
ps:注意v一定是大写的
(2)、查看已经安装的第三方的类库:
pip list
(3)、类库安装:
pip install 库名
ps:如需安装指定版本,在类库后面添加对应的版本号:pip install 库名=版本号
(4)、查看已经安装的类库信息:
pip show 类库名
(5)、卸载已经安装的类库:
pip uninstall 类库名
(6)、查看类库安装目录:
pip show -f 类库名
(7)、搜索类库:
pip search <搜索关键字>
(8)、查看可升级的类库:
pip list -o
python -m pip uninstall pip
以上就是云梦编程为大家介绍的关于pip的常用命令,了解更多相关文章请关注云梦编程网!