On Fri, Jul 20, 2018 at 10:45 AM, Al Sweigart <asweig...@gmail.com> wrote: > The goal of this idea is to make it easier to find out when someone has > installed packages for the wrong python installation. I'm coming across > quite a few StackOverflow posts and emails where beginners are using pip to > install a package, but then finding they can't import it because they have > multiple python installations and used the wrong pip. > > For example, this guy has this problem: > https://stackoverflow.com/questions/37662012/which-pip-is-with-which-python > > I'd propose adding a simple line to the output of "pip install" that changes > this: > > user@user:~$ pip3 install pyperclip > Collecting pyperclip > Installing collected packages: pyperclip > Successfully installed pyperclip-1.6.2 > > ...to something like this: > > user@user:~$ pip3 install pyperclip > Running pip for /usr/bin/python3 > Collecting pyperclip > Installing collected packages: pyperclip > Successfully installed pyperclip-1.6.2 > > This way, when they copy/paste their output to StackOverflow, it'll be > somewhat more obvious to their helper that they used pip for the wrong > python installation. > > This info would also be useful for the output of "pip info", but that would > break scripts that reads that output. > > Any thoughts?
You can get some very useful information from "pip3 --version". As well as pip's own version, it tells you the version of Python that it's running under, AND what directory it's being run from. If you want to request that similar info be added to other commands, I would strongly recommend lifting the exact format of --version and using that. (I'm not sure what "pip info" is, btw. My pip doesn't seem to have that.) ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/