Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] --editable Permission Denied #4667

Open
DanSheps opened this issue Oct 3, 2024 · 2 comments
Open

[BUG] --editable Permission Denied #4667

DanSheps opened this issue Oct 3, 2024 · 2 comments

Comments

@DanSheps
Copy link

DanSheps commented Oct 3, 2024

setuptools version

75.1.0

Python version

Python 3.11

OS

RHEL 8.8

Additional environment information

Virtual Environment
venv is typically executed by sudoing to a specific user and running the venv/bin/python or venv/bin/pip

Main user is "dan", other user is "python" (for simplicity)

Description

I have a few editables installed in a virtual environment.

When I try to install a new editable via pip by running the following command sudo -u python /opt/venv/bin/pip install /opt/new-editable I typically get a "Permission Denied".

If I cd to a directory where "python" has permission to write first ("/tmp" for example), the install will typically succeed.

Expected behavior

Installation of the editable to succeed regardless of the directory the pre-sudo user is in.

How to Reproduce

  1. Create a second user for running the venv ("python")
  2. Create the venv with the user (sudo -u python \which python3.11` -m venv /opt/venv/venv`)
  3. Create 2 editable packages
  4. Install the 2 packages, one at a time, into the venv as the user (sudo -u python /opt/venv/venv/bin/pip install -e /opt/venv/second_editable/)

Output

[dan@dev ~]$ sudo -u python `which python3.11` -m venv /opt/venv/venv
[dan@dev ~]$ sudo -u python /opt/venv/venv/bin/pip install -e /opt/venv/first_editable/
Obtaining file:///opt/venv/first_editable
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Building wheels for collected packages: first_editable
  Building editable for first_editable (pyproject.toml) ... done
  Created wheel for first_editable: filename=first_editable-0.0.1-0.editable-py3-none-any.whl size=2833 sha256=589ba39d2e2953e1df8df4a1005b462b0f3d356b81e0c7761295bb9b7dcdd6ae
  Stored in directory: /tmp/pip-ephem-wheel-cache-0cjmayom/wheels/f2/c7/26/b1d532a00a1d34a5be737c43ae10a72f8f38aa0715ab6c88b3
Successfully built first_editable
Installing collected packages: first_editable
Successfully installed first_editable-0.0.1

[notice] A new release of pip available: 22.3.1 -> 24.2
[notice] To update, run: python3.11 -m pip install --upgrade pip
[dan@dev ~]$ sudo -u python /opt/venv/venv/bin/pip install -e /opt/venv/second_editable/
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '__editable__.first_editable-0.0.1.finder.__path_hook__'
Check the permissions.


[notice] A new release of pip available: 22.3.1 -> 24.2
[notice] To update, run: python3.11 -m pip install --upgrade pip
@DanSheps DanSheps added bug Needs Triage Issues that need to be evaluated for severity and status. labels Oct 3, 2024
@DanSheps
Copy link
Author

DanSheps commented Oct 3, 2024

I can zip up the directory structure if you want but they are really bare bones packages (editable/pyproject.toml, editable/init.py)

@abravalheri
Copy link
Contributor

Hi @DanSheps could you please provide the following information:

  1. Please run pip in the verbose mode and share with us the log.
  2. Could you please stop before installing the second package and run some tests to make sure the first package is working.
  3. Could you please share the structure of each one of the packages (e.g. the output of tree)?
  4. Could you please share each one of pyproject.toml?

@abravalheri abravalheri added Waiting User Feedback and removed Needs Triage Issues that need to be evaluated for severity and status. labels Oct 15, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants