Skip to content
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

If a user have cache/pip installs in ~/Library, relocatable python may not create the right framework #7

Closed
erikng opened this issue Dec 2, 2020 · 2 comments

Comments

@erikng
Copy link
Contributor

erikng commented Dec 2, 2020

When building a relocatable python, a user might see

Requirement already satisfied: setuptools in /Users/erikg/Library/Python/3.9/lib/python/site-packages (49.2.1)
Processing /private/tmp/tmppluiasm6/pip-20.2.3-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-20.2.3
Upgrading pip installation...
WARNING: The directory '/Users/erikg/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

This happens when a user has installed the same Python version as relocatable python and installed modules with --user

Attempting to work around this by specifying --root doesn't work due to a long standing bug with pip: pypa/pip#3063

After talking to @gregneagle , the best solution is likely to implement a WARNING to users when they are in this state.

The conditionals to look for will be:

  1. ~/Library/Python/%VERSION%"
  2. ~/Library/Caches/pip

The latter may not matter since it's just a cache.

@erikng
Copy link
Contributor Author

erikng commented Dec 7, 2020

Closing due to merged PR

@erikng erikng closed this as completed Dec 7, 2020
@benoit-pierre
Copy link

How can that be possible when pip / ensure_pip are called with python -s (disabling the user-site directory)? Might it be that the code should set PYTHONNOUSERSITE=1 in the environment instead to ensure sub-processes are also properly isolated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants