pip命令使用详解「建议收藏」

pip命令使用详解「建议收藏」pip很像CentOS系统中的yum命令,用于安装及维护Python包。pip的安装windows其实在windows下是默认安装了pip工具的,只是没有将其所在目录加入Path,导致命令查找不到。将python安装目录下的scripts目录加入环境变量Path中即可。Linux执行下面命令即可完成安装#wgethttps://bootstrap.pyp…

大家好,又见面了,我是你们的朋友全栈君。

pip很像CentOS系统中的yum命令,用于安装及维护Python包。

pip的安装

windows

其实在windows下是默认安装了pip工具的,只是没有将其所在目录加入Path,导致命令查找不到。
这里写图片描述
这里写图片描述
将python安装目录下的scripts目录加入环境变量Path中即可。

Linux

执行下面命令即可完成安装

# wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
# python get-pip.py

pip使用

安装包

pip install package_name

查看某个已安装包

pip show --files package_name

检查哪些包需要更新

pip list --outdated

升级包

pip install --upgrade package_name

卸载包

pip uninstall package_name

使用pip –help命令可以查看pip帮助手册

# pip --help

Usage:
  pip <command> [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.计算包的hash值 
  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.
  --no-color Suppress colored output
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/139952.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Android P Preview1 兼容要点[通俗易懂]

    AndroidPPreview1,昨天3.8发布,兼容Preview1主要改下targetSdkVersion=28compileSdkVersion为前一个版本(比如27)在AndroidStudio3.2下能完整支持AndroidPPreview1AndroidPPreview1要点1.1约束调用非API接口:比如用JNI、反射来调用一下系统类、方法    Android…

    2022年4月15日
    45
  • 远程服务器虚拟显示器(Ubuntu 20.04 LTS)[通俗易懂]

    远程服务器虚拟显示器(Ubuntu 20.04 LTS)[通俗易懂]远程服务器虚拟显示器(Ubuntu20.04LTS)1.准备工作2.安装软件包3.修改配置文件4.卸载虚拟显示器1.准备工作安装sshsever并开启,确保虚拟显示器配置失败后,无法正常显示,仍可以通过ssh连接至服务器sudoapt-getinstallopenssh-server查看ssh服务已经开启,并可以远程ssh连接至服务器ps-e|grepssh测试远程连接2.安装软件包sudoapt-getinstall

    2022年8月21日
    5
  • m3u8格式视频源列表[通俗易懂]

    m3u8格式视频源列表[通俗易懂]平时,需要测试m3u8格式视频的播放,会使用一些可用的播放源,整理在这里:constsourceList=[{name:’cctv1′,src:’http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8′},{name:’cctv2′,src:’http://ivi.bupt.edu.cn/hls/cc…

    2022年6月26日
    72
  • MySQL 创建数据库和创建数据表

    MySQL 创建数据库和创建数据表MySQL 创建数据库和创建数据表 MySQL 是最常用的数据库 在数据库操作中 基本都是增删改查操作 简称 CRUD 在这之前 需要先安装好 MySQL 然后创建好数据库 数据表 操作用户 一 数据库操作语言数据库在操作时 需要使用专门的数据库操作规则和语法 这个语法就是 SQL StructuredQu 结构化查询语言 SQL 的主要功能是和数据库建立连接 进行增删改查的操作 SQL 是关系型数据库管理系统的标准语言 SQL 语言的作用 1 数据定义语

    2025年10月12日
    4
  • ubuntu学习的简单笔记

    l vi编辑器开发步骤A)输入 vi Hello.javaB) 输入 i 插入模式。C)输入 冒号。【保存退出:wq】【退出

    2021年12月28日
    47
  • Python实现“EMD\EEMD\VMD+Hilbert时频图”与“CWT小波时频图”

    Python实现“EMD\EEMD\VMD+Hilbert时频图”与“CWT小波时频图”Python实现“EMD\EEMD\VMD+Hilbert时频图”与“CWT小波时频图”  信号处理中常需要分析时域统计量、频率成分,但不平稳信号的时域波形往往复杂、无序,且傅里叶变换得到的频率成分是该时间段内的平均频率,无法分析频率随时间变化的情况。随后,短时傅里叶变换(STFT)、小波变换(WT)、希尔伯特变换(HHT)等时频分析方法相继而出。  其中,STFT受时间窗口的影响、WT则需要自己选择小波、HHT在变换时需要预先将信号分解为平稳信号。由于网上只有CWT小波时频图的python代码,笔者自

    2025年6月14日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号