Currently when running pip install <pkg>
we get no information about how we are installing a package. For example:
$ pip install --user calldules
Collecting calldules
Installing collected packages: calldules
Successfully installed calldules
I think it would be extremely useful to list some of this information so we know what's happening. Such as version of pip, version of python, where is pip, where is package being installed, what version of the package was installed. For example:
$ pip install --user calldules
Using pip 7.1.2 from /usr/lib/python3.5/site-packages (python 3.5)
Install location: /home/ivo/.local/lib/python3.5/site-packages/
Collecting calldules
Installing collected packages: calldules (1.0.1)
Successfully installed calldules
Now I know that I used the right python, the right pip, I installed to a good location, and what version of the package I installed.
It might be helpful to provide more information for other commands as well. uninstall
, for instance, already tells you the exact location of the package files you're uninstalling, so I know I'm getting rid of the right thing. pip list
, however, doesn't tell me anything about where the packages are located.
This issue looks reasonable, however if/when it gets implemented we want to make sure not to add a bunch of extra output by default. We've done a lot of work at reducing the noise of a pip install and we don't want to regress on that front. Perhaps adding most/all of this behind a -v
flag or limiting it to just which Python we're installing to by default.
Something like the version and pip location at least would be very useful - we get a lot of issues with just the pip install
output and getting these details would cut down on the followup questions needed to understand the situation.
I've marked this as "deferred to PR" assuming that whoever implements will make a decision and we can weigh the pros/cons at that point. Personally I don't think having the pip -V
-equivalent output as the first line would be very controversial.
Where should this information go? I mean when I look into install
command's run
method, I see that the logging information has been put into the functions which are doing some specific operation.
Since this is a general info. while running install command, should this be added within the run
method directly?
The code for install
command is a bit overwhelming for me. So, not exactly able to deduct this part.
Implementation-wise, the simplest choice would be to add the install location to the top of install_given_deps
, either by changing to current Installing collected packages log or on its own. This may not be the most user-friendly option, but is the easiest to both implement and maintain.
I see, thanks for the pointer.
If we keep it at the position you pointed to. It'd be shown at the bottom of the logs i.e. after collecting all the packages. Won't it help to keep it at the top as also suggested by the OP?
I was thinking of putting it here - https://github.com/pypa/pip/blob/master/src/pip/_internal/operations/prepare.py#L388.
Let me know what do you think about it.
That鈥檚 why I said the solution is not the most user-friendly. But other solutions would introduce additional maintenance overhead, since you don鈥檛 need to know where about those information otherwise. There is a trade-off.
I was wondering if it'd be more helpful if we provide the message regarding the install location at the end as Successfully installed <package> at <install_location>
. I would definitely want others to chime in and give their suggestions.
When it's installed successfully, I believe that we can get such information from pip show
. About the original issue, I think one additional use case apart from knowing the success case is when it fail, for debugging.
Yeah, the scenario this info would be most useful is when the installation fails (or would have, but the user has a chance to ctrl-C when they see the wrong location).
I see, yeah that makes more sense. I'd go with keeping the install location at the starting of logs.
Most helpful comment
Yeah, the scenario this info would be most useful is when the installation fails (or would have, but the user has a chance to ctrl-C when they see the wrong location).