-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Behavior of --user in virtualenv #4141
Comments
I'm assuming this doesn't merit a response from the team, but if anyone else is interested, I made a very simple shell function that wraps pip, serving as a guard to keep everything user-installed unless you're in a virtual environment. |
I'm pretty sure it does and I agree that |
It sounds reasonable to me that The reason for slow progress on anything related to |
As to |
I'm not sure that comment's completely clear. I'd be inclined to suggest someone tests it. Also, I don't know if Python 3 "venv" style virtual environments work the same. In any case, I'd be just as happy to argue that |
Update: I just tested and both (Interestingly, |
I raised Document access to |
This change is intended to improve isolation by hiding packages installed in other virtual python environments. It is also an attempt to fix #2. Virtualenv does not support user site packages directories by default. There is some discussion about it here: pypa/pip#4141 By using the real python instead of a virtual one (which might be virtualenv) support for user site packages directories should be restored.
Description:
I've set up a user-specific
pip.conf
file to make all installations apply the--user
flag, like so:This is especially handy in a multi-user system, so individuals can avoid accidentally polluting the global Python installation, but it has a lot of value on a single-user system as well, since it reduces the use of sudo.
When using a standard virtual environment, though, we get the expected error:
It's good to have a warning explaining why this fails, but is there a reason it's not simply ignored altogether? Since the documentation acknowledges that the
--user
flag has no application in a virtual environment, why not treat it as a no-op? I assume the pip team is smarter than I am, so I'm genuinely curious as to whether its a matter of simpler operation, less surprise, etc.I know I could make a virtualenv-specific configuration file, but there's no simple way to have it automatically apply to each new virtual environment. #2081 goes over some of this same territory, but it doesn't look like it was ever addressed.
Any insight or persistent solutions would be appreciated; I'm sure this can't be a unique situation.
(Thanks pip team for your great work! Anyone who remembers Python development before pip knows how valuable this project is; the fact that it's taken me this long to run into any issues is a testament to the quality here. 👏 👍 )
The text was updated successfully, but these errors were encountered: