-
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
Cannot install into user site directory with editable source. #7953
Comments
This affects the
I'm adapting @agoose77's workaround into a |
Ran into this today on debian 9, not sure what has changed but we have been using |
Seeing this on macOS as well. |
I have seen this failing for a project that uses |
@tgpfeiffer, please see the discussion on Discourse for more information. Aside from |
Following the tip from @agoose77, I'm putting this in my
|
Nobody was able to fix this in pip? The whole idea of pep517 was to reduce use of setup.py ending in its removal, not adding more junk into to it. |
Implements workaround for failure to install as editable on certain cases when --user is mentioned. Related: pypa/pip#7953
@ssbarnea PEP 517 doesn't support editable installs, so I don't see how PEP 517 is relevant here? |
@pfmoore you can support an editable install in a project using PEP 517 by adding a rather minimal setup.py. But then, it is impossible to have |
I don't know, but doing a pip install --user --no-use-pep517 -e . succeeds, and after that a pip install --user -e . doesn't fail anymore. However, this still fails: pip install --user --force-reinstall -e . |
* Fix exception when invalid strategy is specified
* Fix exception when invalid strategy is specified
I also ran into this today. Is this intentionally not supported? I'm not sure why, I'd find it useful. |
Apparently this is still broken at least for projects using PEP-517 (no setup.py). Tested with latest I suspect it is related to built isolation stuff. Also worth noting another error when I tried to enforce pep517: |
We had this problem on at least ubuntu 22.04 but it works with the most recent versions of pip and setuptools in the venv (which you get if you create the venv with --upgrade-deps) doesn't seem to work if you try to upgrade at least pip and setuptools after it's created though. For some reason system paths are added to the venv sys path. |
That’s #11430 |
FTR: the |
Raised bugs against distros shipping outdated setuptools:
|
This fixes an issue that arises due to the crossover of three different problems: 1. Ubuntu 22.04 will be used by default on 'ubuntu' runners on GitHub runners (actions/runner-images#6399). 2. Ubuntu 22.04 ships with `setuptools` version 59.x.x, which has a bug that does not allow an `--editable` installation of packages in `--user` mode. The flag `--user` is presumed regardless, as the location with packages is not writable by normal users (see pypa/pip#7953 and https://bugs.launchpad.net/ubuntu/+source/setuptools/+bug/1994016). 3. We need an `--editable` installation in order to run tests, as the `test_data` folder is loaded with respect to the package root, and not the test root (see for example: https://github.com/xsuite/xpart/blob/45d621ad060bc25d361835bde1ed985609a24c49/tests/test_single_rf_harmonic_matcher.py#L25) Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Pin the GitHub runners to `ubuntu-20.04`. Long term solutions should be explored at some point in the future. This fixes an issue that arises due to the crossover of three different problems: 1. Ubuntu 22.04 will be used by default on 'ubuntu' runners on GitHub runners (actions/runner-images#6399). 2. Ubuntu 22.04 ships with `setuptools` version 59.x.x, which has a bug that does not allow an `--editable` installation of packages in `--user` mode. The flag `--user` is presumed regardless, as the location with packages is not writable by normal users (see pypa/pip#7953 and https://bugs.launchpad.net/ubuntu/+source/setuptools/+bug/1994016). 3. We need an `--editable` installation in order to run tests, as the `test_data` folder is loaded with respect to the package root, and not the test root (see for example: https://github.com/xsuite/xpart/blob/45d621ad060bc25d361835bde1ed985609a24c49/tests/test_single_rf_harmonic_matcher.py#L25) Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Workaround for pypa/pip#7953
We are affected by this pip bug: pypa/pip#7953 The version of pip that ships with ubuntu 22.04 cannot install in editable (-e) mode in the user directory (--user).
…ssues/7953. Only need to sys.path modification to get version
* Apparently have to require the 'wheel' package be present * setup.py: Workaround for pypa/pip#7953 * Keep flake8 happy * Minor typos * Comments now show only needs correct pip. The required setuptools can be specified in the requires= * With guaranteed correct setuptools, can remove the fix for pypa/pip/issues/7953. Only need to sys.path modification to get version * Extra github job to test on Ubuntu without conda * Apparently need to install numpy, too * Try without the apt-get update * Can I sudo it? * Remove redundant numpy install * Rename future.pyproject.toml to pyproject.toml * Update pyproj comments, now we have a way forward * Just checking it fails when I think it should.... * Seems I no longer need the pip upgrade..... hmmm..... * Update pyproj comments accordingly * Turns out I need the pypa/pip#7953 fix for editable installs * Turns out I need the pip>=23.0 for editable installs only. Added a note about this to pyproject.toml * Remove old setup.py and bin/*.py * Put back the pip upgrade, as it seems we need that when we don't have setup.py (maybe) * Update comments about requirement for pip>=23.0
In
build_env.py
the environment variablePYTHONNOUSERSITE
is set:pip/src/pip/_internal/build_env.py
Line 127 in 7b02273
This prevents editable installs with
PYTHONUSERBASE=<some-user-base> pip3.8 install --user -e <some-file-path>
from succeeding if the user does not have write access to the base-Python site-packages directory.This is a snapshot of the error.
It may be that it is a deliberate design choice to disable editable installs under a user site directory. I personally needed this feature, however, and I am therefore setting
site.ENABLE_USER_SITE = True
insetup.py
as a workaround.The text was updated successfully, but these errors were encountered: