Pip: Allow to silence download progress bar

Created on 21 Jan 2015  路  5Comments  路  Source: pypa/pip

Version 6.0 of pip introduced a download progress bar to make make watching pip download a package more enjoyable. Until version 1.5.6 the progress was only indicated by a percentage count moving up.

The verbose progress bar is nice in general, however, it fills log files more quickly (e.g. when you log automatic deployments) and makes them less readable. Unfortunately, it doesn't look like that it's possible to silence only the progress bar, just --quiet is available as a command line option, which then silences the execution of (e.g.) pip install -r requirements.txt completely though.

An option to selectively silence parts of the installation progress, including the download progress bar specifically, would be very nice.

auto-locked

Most helpful comment

This works for run() but not for sudo() (unless sudo is configured to allow non tty commands).
Surely this can be resolved somehow, but why couple these two so separate concerns?
a --no-progress seems like a good focused solution. for CI systems, the progress bar is really just extra noise.

All 5 comments

Hmm, the download bar should only show itself if sys.stdout is a tty. Is whatever you're using to log pretending to be a tty without supporting ANSI escape codes?

Example:

$ pip install Django --no-cache-dir | cat
Collecting Django
  Downloading Django-1.7.3-py2.py3-none-any.whl (7.4MB)
Installing collected packages: Django

Successfully installed Django-1.7.3

Doesn't show the progress bar because a pipe isn't a tty.

That's Fabric executing pip install -r requirements.txt from within a Vagrant box (the latter probably doesn't make a difference). The output is triangles growing from the left are drawn instead of a static growing bar. Something like a CR -> LF (\r to \n) translation is happening.

The Fabric run() command uses SSH underneath.

I think what you want to do is just pass pty=False to your run command that uses pip.

@dstufft Passing pty=False as an argument to run() in Fabric works fine. Thanks!
Related documentation is found in the Interaction section of the Fabric docs.

This works for run() but not for sudo() (unless sudo is configured to allow non tty commands).
Surely this can be resolved somehow, but why couple these two so separate concerns?
a --no-progress seems like a good focused solution. for CI systems, the progress bar is really just extra noise.

Was this page helpful?
0 / 5 - 0 ratings