返回介绍

pip

发布于 2021-04-05 05:11:52 字数 6056 浏览 937 评论 0 收藏 0

Usage

pip <command> [options]

Description

Logging

Console logging

pip offers -v, –verbose and -q, –quiet to control the console log level. Each option can be used multiple times and used together. One -v increases the verbosity by one, whereas one -q decreases it by one.

The series of log levels, in order, are as follows:

VERBOSE_DEBUG, DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL

NOTIFY is the default level.

A few examples on how the parameters work to affect the level:

  • specifying nothing results in NOTIFY
  • -v results in INFO
  • -vv results in DEBUG
  • -q results in WARN
  • -vq results in NOTIFY

The most practical use case for users is either -v or -vv to see additional logging to help troubleshoot an issue.

File logging

pip offers the –log option for specifying a file where a maximum verbosity log will be kept. This option is empty by default. This log appends to previous logging.

Additionally, when commands fail (i.e. return a non-zero exit code), pip writes a “failure log” for the failed command. This log overwrites previous logging. The default location is as follows:

  • On Unix and Mac OS X: $HOME/.pip/pip.log
  • On Windows, the configuration file is: %HOME%\pip\pip.log

The option for the failure log, is –log-file.

Both logs add a line per execution to specify the date and what pip executable wrote the log.

Like all pip options, --log and log-file, can also be set as an environment variable, or placed into the pip config file. See the Configuration section.

General Options

-h,--help

Show help.

-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.

--log-file<path>

Path to a verbose non-appending log, that only logs failures. This log is active by default at <see File logging>.

--log<path>

Path to a verbose appending log. This log is inactive by default.

--proxy<proxy>

Specify a proxy in the form [user:passwd@]proxy.server:port.

--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.

--cert<path>

Path to alternate CA bundle.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文