Skip to content


Subversion checkout URL

You can clone with
Download ZIP


ability to display *only* changed output when `pip install`ing #1537

deanmalmgren opened this Issue · 4 comments

3 participants


I've been using things like puppet, chef, and most recently fabtools to manage python installations. One feature that I generally like about these tools is that they only emit output when something has been installed. If its already installed, no output is emitted. To be more specific, the behavior I'd like to have is something like what -Q does below:

[prompt]$ pip install -Q dix
Downloading/unpacking dix
  Downloading dix-0.11.tar.gz
  Running (path:/path/to/build/dix/ egg_info for package dix

Installing collected packages: dix
  Running install for dix
    changing mode of build/scripts-2.7/dix from 644 to 755

    changing mode of  /path/to/bin/dix to 755
Successfully installed dix
Cleaning up...
[prompt]$ pip install -Q dix # NO OUTPUT!

Note that the second time this runs there is no output because dix is already installed. This is not currently possible with the pip install command.
The second time pip install is run, the "Requirements already satisfied..." should not be displayed and the "Cleaning up..." line should only be displayed if and only if something was actually installed.

Have you contemplated having a separate logging level for something along these lines? Is there a better way to approach this? Is there any other reason not to incorporate this into pip?


One feature that I generally like about these tools is that they only emit output when something has been installed.

Can you say why this is a compelling feature?

I think maybe a better method would be to have a flag that would output easily computer-readable, stable text, like git's --porcelain.


Thanks for the quick response, @Ivoz! The short answer is that I think it is useful to only see what is being changed. Perhaps a better name for the option would be something like --diff-output or something more intelligible than the ambiguous -Q name.

To better explain why I think this is compelling, here's a typical use case for how my development projects tend to look:

  1. Create an initial build of a server with the bare-bones stuff on it that I know I'll need for my project with packages X, Y and Z, let's say, that are in a REQUIREMENTS file. Running pip install -r REQUIREMENTS for the first time installs a bunch of packages and it tells me about it, which makes a lot of sense. I've just added them to the server, afterall and its nice to see that they've correctly installed, compiled, etc.
  2. Next I write a bunch of code that uses X, Y, and Z. Continue pushing this code to the aforementioned server, debugging things along the way. Everything is working great until...
  3. I realize I need another package called A. I add A to my REQUIREMENTS file and re-run pip. When running pip, it tells me that it correctly installs A, but it also tells me that the requirements for X, Y and Z have already been satisfied.
  4. I tend to repeat steps 2-3 roughly 10-15 more times during each project I do, adding anywhere from 1 to 5 packages in step 3 and I typically do a half dozen of these things a year.

The reason I think this is a compelling feature is that, once you have ~10 packages in REQUIREMENTS, it can be very difficult to differentiate the output for adding a new package or two from the output saying that the ~10 package requirements have already been satisfied. I end up having to closely examine the logs to see what is going on. This is particularly challenging when I'm not the only person editing the REQUIREMENTS file. When you're in a team of people that are all adding packages to REQUIREMENTS, it can be hard to see whether new packages have been added since your last installation if the installation output is buried in "requirements already satisfied" statements.

Emitting machine readable output might make it easier for puppet/chef/fabtools to selectively print output in these types of situations or, more generally, for anyone to selectively filter the output that a user sees. I'm pretty indifferent about a vagrant-style --machine-readable option versus something like --diff-output/-Q. The end result is that, when I'm provisioning REQUIREMENTS files with puppet/chef/fabtools, that it is easy to see what is being changed on the server.


Is it not possible to run pip freeze before and after each installation and compare the two? It's more manual than what you are suggesting, maybe, but it seems like it captures basically what you're trying to achieve (report differences in the installed packages).


That's a possibility, sure. I could also just do pip install -r REQUIREMENTS | grep -v "Requirements already satisfied". I was just proposing a way to do this out of pip itself. There's already a -q and -v option and it seemed like it might be a natural extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.