-
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
pip/_internal/locations.py not respecting site.ENABLE_USER_SITE #7055
Comments
#4575 is tracking the implementation of the ability to specify which of the system, user, or virtual environment (among other schemes) you want pip to manage at a given time. In the meantime if you try e.g. IMO the environment pip is managing packages for is independent of whether the packages for that environment are in |
Adopting this for now.
I don't follow you here. Setting PYTHONNOUSERSITE just sets ENABLE_USER_SITE=False in site.py. I don't see what that has to do with sys.path at all... IMO that single boolean (ENABLE_USER_SITE=False) should make anything in the user site (~/.local/lib/pythonx.y/site-packages/) invisible to everybody, pip included. Is this understanding incorrect? It almost seems like a problem in site.py: pip's calls to getusersitepackages() shouldn't return an actual path if |
The documented behavior of
I think that managing packages in the user site (or any package-holding directory) is unrelated to this. Pip being influenced by the default Python behavior causes a lot of confusion in general (see #6703, #6558, #5040). If you could explicitly say |
I don't think you're misunderstanding anything other than what I'm "proposing". I'm only trying to report a perceived bug in which pip sees user packages in spite of PYTHONNOUSERSITE being set. I'm going to close because I think my problem arises from use of a sitecustomize.py which made modifications to site.USER_BASE and site.USER_SITE but didn't remove paths which has already been erroneously added to sys.path. |
Environment
Description
user site is disabled in site.py (and command-line [-s], and PYTHONNOUSERSITE env var)
but pip is still looking in ~/.local/lib/python*/site-packages/ during (un)installation of packages
Expected behavior
pip should respect site.ENABLE_USER_SITE=False
How to Reproduce
pip install --user -e ~/xanity-src/
PYTHONNOUSERSITE=1 /opt/my-python/bin/python -m pip install -e ~/xanity-src/
PYTHONNOUSERSITE=1 /opt/my-python/bin/python -m pip uninstall xanity
Output
The text was updated successfully, but these errors were encountered: