-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Feature request: keep track of how packages are installed (manually, automatically, ...) #9812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
pip already does keep track of this, see #8026. It turns out the idea of “manually installed” is not really that useful due to how installation works, but feel free to experiement with it and see what can be done. |
Thank you - https://www.python.org/dev/peps/pep-0376/#requested is a valuable resource. I'll use that for some further reading. |
Closing since I don't think we have anything actionable here. |
What do you mean by "due to how installation works"? I understand that once you install from a If so, maybe Maybe
I will, thank you. Ultimately, I hope this can speed up the resolver, or at least give it some idea from which direction best to approach the vast space of version combination. For my reference, are there any features which use the |
Sorry I was probably too brief in the previous comment. What I meant to say was the feature was implemented for something else, but that thing ended up requiring much more information than simply “did the user specify the package from the command line”, so the |
Uh oh!
There was an error while loading. Please reload this page.
What's the problem this feature will solve?
Large requirement files with many packages are a pain to install from. I am just migrating from Python 3.8 to 3.9 using a requirements file with 280 entries, and it's not going well. I have already relaxed or removed some requirements manually, and at one point,
pip
tried to downgrade itself to some version 6.x.I think the problem is due to the new resolver and the fact that finding a working combination of 280 packages is hard. In addition, there are cases (such as when upgrading all installed packages) when it is unclear if A should be upgraded at the cost of downgrading (or not upgrading) B, or B should be upgraded at the cost of downgrading A. All of this will become more complicated once
pip
considers installed packages.What I am missing in
pip
is some prioritization of packages. One manual way of doing this (in my case) is to include only packages at the top level ofpipdeptree
in the requirements file. This way,pip
could focus on installing (new) versions of packages I am actually interested in using.However,
pipdeptree
is only one indication - I may still be using some of the dependent packages directly. A better way would be to keep track of what the user actually installed themselves. Hence, when issuingpip install tensorflow
,pip
should remembertensorflow
as a high-priority/high-interest package, whilesix
is an automatically installed dependency.How is this useful? When considering package upgrades, the following may happen:
We have
A==2
andB==2
installed. When upgrading bothA
andB
, we may haveA==3
available which requiresB==2
, andB==3
which requiresA==2
. [I notice this is a tricky example due to potential cyclic dependencies, but one can easily construct a similar example using two incompatible packagesC
andD
on whichA==3
andB==3
depend, respectively. The point is that ...] ...installingA==3
andB==3
is thus impossible, and the resolver needs to determine which package to upgrade. I have no idea how this is currently done, but knowing thatA
(tensorflow
) was installed manually andB
(six
) is only a dependency should allow the resolver to prioritize the upgrade ofA
.Excuse me if this has been discussed before, but I have not found any such discussion here yet.
Describe the solution you'd like
apt list --installed
shows something like this:While I installed
x11-utils
myself,xauth
was installed automatically.This information should be tracked by
pip
in my opinion, and used in later operations.Users should then also have tools to (un)mark an installed package as relevant/prioritized/... (or just "automatic" is that is functionally the same thing).
The text was updated successfully, but these errors were encountered: