pip list produces error

Created on 5 Nov 2016  ·  45Comments  ·  Source: pypa/pip

$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=legacy (or define a list_format in your pip.conf) to disable this warning.
pip (9.0.0)
setuptools (18.2)
wheel (0.24.0)
auto-locked

Most helpful comment

Text that is not considered an error should not be in stderr.

Running a command the way it is meant to be run should not produce an error message.

All 45 comments

This is not an error. This is a warning about an upcoming change.
Just update your pip.conf to remove this message. cf #4058 for the correct format.

Have to make a pip.conf just to list installed packages without a big red warning in stderr?... Doesn't make sense.

Made myself a fix that allows for seeing actual error messages should they arise, if anybody else is interested:

function pip() {
    case "$1" in
        list)
            $(which pip) "$1" 2>&1 >/dev/null | egrep -iv '.*?deprecation.*?format.*?columns' >&2
            $(which pip) list 2>/dev/null
            ;;
        *)
            $(which pip) "$@"
            ;;
    esac
}

Or you can also put export PIP_FORMAT=legacy in your .bashrc (or equivalent).

You misunderstand. I don't want a legacy format, I simply want 'pip list' to output a list without complaining (about something irrelevant [in caps, in red, in stderr]). You actually have to _upgrade_ pip to version 9 to make it produce this "error".

Then export PIP_FORMAT=columns?

Why would I export a variable for something that 1) always worked fine 2) still works, albeit now annoyingly, & 3) I have no preference toward? 'pip list' should do its job, it should output the list. That's all I want it to do, not stab my eyes with error text that even people like xav say aren't errors. If it's not an error, get it out of my stderr.

It's a deprecation warning, it warns you about an upcoming change that will break things if you depend on it. You've got multiple options to "get it out of your stderr" given to you. _shrug_.

Text that is not considered an error should not be in stderr.

Running a command the way it is meant to be run should not produce an error message.

Alright, I'm going to bow out of this ticket. I don't see anything productive occurring from further participation on my part.

I am, too. It's amazing how people don't understand what stderr is for.

By insisting people export variables they never needed to before, you are actually making more work for people who already didn't naively parse 'pip list' output, and coddling those who do (which would be fine, if it weren't at the expense of others).

You misunderstand. I don't want a legacy format, I simply want 'pip list' to output a list without complaining (about something irrelevant [in caps, in red, in stderr]). You actually have to upgrade pip to version 9 to make it produce this "error".

No, you misunderstand my comment: export PIP_FORMAT=legacy just seems a simpler "fix" than yours.

That's like saying it's simpler to vote democrat or republican when you've always lived in a country with neither. Why would I want to _opt-in_ to a _legacy_?

This message is basically something people have to opt-out of, which is annoying, especially when the way you want them to opt-out of it is to opt-in to using a configuration they may well have never used before; and for what? All I wanted was what 'pip list' always gave me in the past: a list of installed packages, in most any format, without seeing red for _no reason_.

Yeah, so if your pip is old, you get an annoying yellow message telling you to upgrade... and then _if you do what it says and upgrade_, _then_ you get a big _RED_ message telling you some format you probably didn't even care about has changed. FFS

Hi. I am on Windows 10 and want to get rid of this error message, too - but I can not find a pip.conf file. How can I turn that off? Or then will this deprecation warning be discountinued?

image

@Tset-Noitamotua To suppress that message, you have 3 options:

  1. You can create a config file - on windows it's location is %APPDATA%\pip\pip.ini - and add the following to it:

    [list]
    format=columns
    
  2. Export a PIP_FORMAT=columns environment variable. (on windows it's done as set PIP_FORMAT=columns or you can set it in the GUI as described here)

  3. Pass a --format columns to pip list every time you call it. (obviously not convenient, hence the other exist)

@matsaman said:
Text that is not considered an error should not be in stderr.

No. Text that is not considered "output" of a script is meant to be output to stderr.

I could spend more time listing out the reasons. I'd rather request you to go here and read them for yourself - http://stackoverflow.com/questions/1430956/should-i-output-warnings-to-stderr-or-stdout .

It's amazing how people don't understand what stderr is for.

It is.

By insisting people export variables they never needed to before, you are actually making more work for people who already didn't naively parse 'pip list' output, and coddling those who do (which would be fine, if it weren't at the expense of others).

Agreed. But there are always trade-offs.

If making a file for suppressing an error message or exporting an environment variable - which are one time, probably 1 minute tasks - is too much work for you, I don't think it's worth my time to persuade you otherwise.

Thank you for detailed answer! @pradyunsg

I have chosen option 1.

I had to create the folder pip in %APPDATA% (it's C:\Users\UserName\AppData\Roaming on Windows 10) and in that pip folder a file pip.ini with

[list]
format=columns

The deprecation warning is gone and output is now:

C:\Users\UserName>pip list
Package               Version
--------------------- -------
pip                   9.0.1
setuptools            26.1.1
virtualenv            15.0.3
virtualenvwrapper-win 1.2.1

In case somebody wonders where/what %APPDATA% is, you can echo it (and any other enviroment variable)

C:\Users\UserName>echo %appdata%
C:\Users\UserName\AppData\Roaming

or write it in Windows Explorer:
image

image

image

You must to do the follow steps (if you are in Windows like me):

Acess the folder C:\Users\
If dont exists, create in C:\Users a new folder called "pip"
After, enter in folder pip created and create a new file with name "pip.ini".
In this file add the follow lines:
[list]
format=columns

Open the terminal (cmd, cygwin or anaconda prompt) and try again typing:
(name_of_your_env) C:\your_path>conda env export > name_of_file.yaml

Acess the C:\your_path cited in the step 5 and notice that file exported called name_of_file.yaml was be created.

I hope I have helped! Bye!

@ciniro you probably mean C:\Users\UserName where UserName is the actual username of logged in user, e.g. C:\Users\Ciniro

He probably meant that ordinary usage of a tool shouldn't produce error messages like you were doing it wrong.

@matsaman So what solution would you recommend? It is annoying. Can't believe it's been like this for quite long.

@ajaykgp Please see my comment above for how to supress the message.

@ajaykgp the only solution is for people thinking that an application operating normally should output red error text to reevaluate their schemata

The issue with @pradyunsg 's solutions is that, if the default will switch to columns, adding it to conf basically produces garbage/useless config when the switch happens. As @matsaman said, it's penalizing users who are using pip the way pip authors expect.

I'm not sure how pip is used by the masses, but personally I think the fact that a major version bump may not be backward compatible is expected. I haven't seen many (any?) other tools that print red errors (red = error, yellow = warning) like this that can only be suppressed by explicitly setting the to-be default value (not the "right" thing to do, I'd say), which may benefit 1% of the users and hurt the other 99%.

In other words, I'm curious about the importance of this change for the majority of users. Suppose there's no such error in stderr and it's just put in release notes. Those who care should know. When pip 10 lands, those who rely on the legacy format can simply change their format, and they will know to do it because it'll break for them. It's a one time change for that 1%, and the 99% don't need to do anything. If the 1% relies heavily on the output of pip list, they should understand that upgrading from 9 to 10 may be a breaking change and don't just do it blindly and assume things won't blow up.

Every time I pip list I get annoyed by the red error, but I've not added the line to pip.conf - not because I don't have a minute to spare, but because I don't want to create mystic config that I don't know why it's there or what to do with it in the future. Here's the hope that pip10 will come sometime soon...

Use this command it will works
pip list --format=columns

I don't want to create mystic config that I don't know why it's there or what to do with it in the future.

Fair enough. :)

I don't mean to extend this discussion further, I'll just note that you could even export an environment variable (PIP_FORMAT=columns) to suppress the message.

In fact to close my further participation, I'll say this ship has sailed and there's nothing that can be done about it. Maybe there was a better way but it's too late to fix that. That said, I think that the mitigation strategies currently provided are enough for nearly all users. None the less, I do take away from this issue that some users feel _extremely_ strongly about what is output-ted on their terminal and will keep that in mind. :)

Maybe there was a better way but it's too late to fix that.

Nah, it's never too late to fix things. It can be too late for an individual person or set of persons to be _interested_ in wanting to fix things, though, if they're resigned to be disinterested.

some users feel _extremely_ strongly about what is outputted on their terminal

Yes, well, a big red warning for using a command correctly is extreme(ly wrong).

Nah, it's never too late to fix things.

Well, it'll be fixed in the next pip version when the new format becomes the default. So there's nothing more we need to do here, I guess :smile:

Well, it'll be fixed in the next pip version when the new format becomes the default.

Ten months & counting.

I'm not trying to pick a side here, just trying to understand the opinions in favor of this error message. What's the difference between completely changing the output of an option to the new desired output and making an in between step with a broken output? I don't quite get the difference, but I guess we'll have to live with it for a few more months

@dhulke I think the point is that the majority of people don't feel that the intermediate step was "broken" output. A few people have expressed strong feelings here, but that's far from being the majority of pip users...

I don't think it's fair to say that majority people don't feel it's broken. Yes, it's not a security loophole or making pip nonfunctional. But it's still an annoyance to many. Truth is, majority of people don't bother create a GitHub issue for it or just about anything they use, even though they may get annoyed or wonder what the message is.

It's probably more fair to say that for the absolute majority of users (99.99%+, even), this message brings zero value whatsoever.

Most people use a tool and simply move on. People here care enough to leave their opinion. You have your own opinion that it's not broken and we fully respect that. But pip is a tool used by millions of people, and it'd be great if its developers are thoughtful of the users.

I don't think it's fair to say that majority people don't feel it's broken. Yes, it's not a security loophole or making pip nonfunctional. But it's still an annoyance to many.

I don't know anyone (including me) who is annoyed enough by it to complain here, but not annoyed enough to simply silence the deprecation warning by using one of the many possibilities to do so. I even found another solution to get rid of it: alias piplist='pip list --format=columns'... I use pip freeze most of the time anyway. Heck, I would posit the wild guess, that you can live a happy fullfilled live as a Python developer without even knowing about the existence of pip list :)

Most people use a tool and simply move on.

Then maybe those people should stop a second and think about why this is possible. And especially they should reflect for a second that no one even has to pay for that tool and they still get first class support here by people with the patience of angels explaining over and over again how simple it is to get rid of this deprecation warning if they really feel the need to do it (which is in no way necessary to make productive use of the tool).

@pfmoore absence of evidence is not evidence of the absence :) but i'm not complaining about the output at all. Heck, I don't pay for the tool nor the people who took the time to help and support this ticket, so I'm not complaining at all. I was just wondering if there was a need for this intermediate step at all. People who don't mind that big red message won't bother looking at an ascii formatted table and people who depended on the putput format are already having to change their apps to either legacy or column, so why the intermidiate step? I was just curious about the reasons behind it, but again, i dont feel entitled to an answer when I'm not spendong a single dime on the tool

The history is in #3651 #3654 and #3686. Re-reading the discussions, there wasn't much said about the deprecation warning. Adding a warning for one version before changing something is basically our standard deprecation policy, but I can see that in this case it may have been more disruptive than normal.

I do find the "live with it for a few more months" comment a bit strong, though. If it bothers you that much, set the config and you're done.

I don't know anyone (including me) who is annoyed enough by it to complain here, but not annoyed enough to simply silence the deprecation warning by using one of the many possibilities to do so.

I think this has 3 aspects:

  1. Most people don't bother research how to silence the error, and the project owners may want to keep that in mind and deliver the best experience to all those users.
  2. People in this thread (including me) are bothered by the fact that they need to add something to "fix a problem" when they are already using the tool as intended, and that "something" would become a mystery a year later.
  3. I think this discussion is more around what's the right/best decision to make when there's a breaking change. We are taking the time to express our thoughts (and trying to justify them), not really "complaining" per se.

Then maybe those people should stop a second and think about why this is possible.

I don't think this is the point of discussion here. I'm sure everyone who expressed their opinions here should and are grateful about all the open source projects available, and many of us are also part of the open source community ourselves.

The fact that you, me, and just anyone else in the community is doing open source doesn't mean that we have the "moral highground" to not listen to different opinions and try to take the feedback and make the project better.


Anyway, I think it's a good place where I can stop. pip is something I use daily and I very much appreciate all the hard work project maintainers have put into it. I think it's clear that this is not gonna change in the 9.x release and it will (hopefully) be gone in 10.x. However, I do hope that @pfmoore et al. can incorporate some of our thoughts (re. colors of warning, major semver vs. breaking change, # users affected, etc.) when dealing with this in the future.

Thanks!

@pfmoore im sorry i didnt mean "live with it" that way. I don't personally agree with the deprecation policy, but i meant to say that ill keep using the format option until the next major release comes out. Thanks everyone for the great discussion and support

Then maybe those people should stop a second and think about why this is possible.

I don't think this is the point of discussion here.

That's why I felt like I needed to inject this into the discussion. I just read through this discussion today for the first time with a growing sense of wonderment and tried to add some perspective here.

I just replaced Python 2.7.13 with Python 2.7.14 and this warning again appeared.

We need to replace in 'list.py' in line 137 word 'None' with 'True'

Full path is 'C:\Python27\Lib\site-packagespip-9.0.1-py2.7.eggpip\commands\list.py'

How this works on Linux? I export PIP_FORMAT=columns to my .zshrc and didn't work after closing and opening the terminal. I deleted the line of my .zshrc file and created a pip.conf file in my /.conf/pip.conf with the following...

[list]
format=columns

and didn't work either.

@diazgilberto
I have under my 'cygwin' Python 2.7.10 installation and that problem is solved with edit 'list.py' like this:
2715

cut like this:

2716

Then export PIP_FORMAT=columns?

Worked like a charm on Ubuntu 18.04 & Python 3.6.6 without Anaconda.

You just need to upgrade your pip.That is, "pip install --upgrade pip"

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings