pip install -U does not remember whether a package was installed with --user
See original GitHub issueIf you do
pip install --user dist
pip install -U dist
then the upgrade will uninstall the original installation from the user site-packages and install the upgraded version in the system site-packages. It should not do this, but rather should remember where the package being upgraded was located, and reinstall to the same location.
Issue Analytics
- State:
- Created 10 years ago
- Reactions:2
- Comments:15 (11 by maintainers)
Top Results From Across the Web
pip installs packages successfully, but executables not found ...
I know the question asks about macOS, but here is a solution for Linux users who arrive here via Google. I was having...
Read more >Pip: Installing Python Packages
Pip is a special program used to install Python packages to your system. ... If you have only one version of Python installed...
Read more >Pip Install: Install and Remove Python Packages
First things first: we need to install pip itself. The good news is that Pip is probably already present on your system. Most...
Read more >How to install modules with PIP (and fix it when it fails) - Medium
First make sure that you have installed Python. Assuming that, the first thing to do is to check if the module exists. The...
Read more >How to Install and What is Python Pip? - DataCamp
If the package you are looking to use is already installed but simply out of date. You can update the package in a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ohk. 💡 There seems to be consensus on that behavior them. I have an idea/proposal…
AFAIK, there are 3 possible schemes for packages:
--system
)--user
)--local
)pip enforces a “working” scheme on every run. Outside a virtualenv, the default working scheme would be “system” (It should really be “user”, that’s another issue #1668). Inside a virtualenv, the default working scheme should be “local”. Passing
--system
or--user
or--local
overrides the working scheme.Only packages in the same scheme as the working scheme can be modified. By modifying, I mean installing or uninstalling a package. Trying to modify a package in a different scheme is not allowed and pip would print a message and error out.
So, modifying a package in system scheme with a “user” working scheme is not allowed. Nor is modifing a package in user scheme with a “system” working scheme. Niether are the other permutations with “local”.
I think this results in a pretty simple behaviour model.
Any comments?
(editted)
It’s not so clear this is a user mistake. Why does pip uninstall package installed using user scheme during
pip install -U dist
while there’s no--user
option given? This is very bad UX. The only sane behavior would be to operate on packages installed in user scheme only if--user
was passed.