首页 > 其他 > 详细

pip命令详解

时间:2020-12-23 08:57:04      阅读:31      评论:0      收藏:0      [点我收藏+]
Usage:   
  pip <command> [options]

Commands:
  install                     Install packages.#安装包
  download                    Download packages.#下载包
  uninstall                   Uninstall packages.#卸载包
  freeze                      Output installed packages in requirements format.#以requirements的格式输出已安装的包
  list                        List installed packages.#查看已安装包(用pip安装的)
  show                        Show information about installed packages.#显示已安装包的信息pip show 包名
  check                       Verify installed packages have compatible dependencies.#验证安装包有没有兼容依赖项。
  config                      Manage local and global configuration.#管理本地或全局配置
  search                      Search PyPI for packages.#在PyPI(python package index)中搜索包
  cache                       Inspect and manage pip‘s wheel cache.#检查管理pip的wheel cache
  wheel                       Build wheels from your requirements.#从requirements中构建wheels
  hash                        Compute hashes of package archives.#计算包存档的哈希值
  completion                  A helper command used for command completion.#命令补全
  debug                       Show information useful for debugging.#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>                Path to a verbose appending log.
  --no-input                  Disable prompting for input.
  --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 or host:port pair 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.
  --no-python-version-warning
                              Silence deprecation warnings for upcoming
                              unsupported Pythons.
  --use-feature <feature>     Enable new functionality, that may be backward
                              incompatible.
  --use-deprecated <feature>  Enable deprecated functionality, that will be
                              removed in the future.
1、常用命令
  -安装包
    pip install packageName            # 安装最新版本
    pip install packageName==1.0.4     # 安装指定版本
    pip install ‘packageName>=1.0.4‘     # 指定安装的最小版本
    注意:安装前会检查是否已安装该包,如果安装不管已安装的包高于或者低于即将安装的包,都会卸载后再安装想安装的包
    (升级包时也是会先卸载原包,再安装升级包,所以个人认为好像不需要使用升级命令,需要哪个版本直接按版本号安装即可)

  -升级包#pip install -U(或--upgrade)  packageName
    pip install -U packageName        #升级到最新版本
    pip install -U packageName==版本号 #指定升级的版本(版本可高于或低于当前版本)

  -卸载包
    pip uninstall packageName

  -安装包到用户区
    pip install --user packageName

  -通过配置文件安装多个对应版本的包(requiement.txt中的格式与pip freeze>requiement.txt格式一样)
    pip install -r requiement.txt

  -pip list #列出通过pip安装的包

  -pip freeze #requirements format导出已安装的包
    pip freeze > requiement.txt

  -pip --version 等同于 pip -V
  -pip --help  等同于 pip -h

  -pip show packageName #查看已安装包信息,包含信息如下
      Name: xlrd
      Version: 1.2.0
      Summary: Library for developers to extract data from Microsoft Excel (tm) spreadsheet files
      Home-page: http://www.python-excel.org/
      Author: John Machin
      Author-email: sjmachin@lexicon.net
      License: BSD
      Location: d:\frameworks\python37\lib\site-packages
      Requires:
      Required-by:

  

 

pip命令详解

原文:https://www.cnblogs.com/Inbreeze/p/14176556.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!