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

[Bug]: generated venv cannot install anything that requires setuptools #131

Open
1 task
tellett opened this issue Jan 20, 2023 · 0 comments
Open
1 task
Labels
bug Something isn't working
Milestone

Comments

@tellett
Copy link
Contributor

tellett commented Jan 20, 2023

What happened?

First off, thank you for all the effort, this tree looks very promising.

After pulling together a few small tweaks to get the virtual environments set up, I ran into an issue that's likely to take longer than I have time for. What I'm seeing is that any package I try to install that requires setuptools (at least I assume) appears to break, not sure why. As an example here is me trying to install pyright into the venv so I can set up code completion in my editor (same issue for python-lsp-server). Perhaps this is related to the other wheel bugs reported against the venv rules?

Note that after adding --strip-extras to pip-compile, and --no-deps to the pip install command I was able to progress further into installing my repos requirements into the virtual environment, but am currently blocked by this.

% pip -v install pyright 
Using pip 22.3.1 from /home/USER/src/REDACTED/.server_bin.venv/lib/python3.9/site-packages/pip (python 3.9)
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/REDACTED/simple/
Collecting pyright
  Downloading https://us-python.pkg.dev/REDACTED/pyright/pyright-1.1.290-py3-none-any.whl (16 kB)
Collecting nodeenv>=1.6.0
  Downloading https://us-python.pkg.dev/REDACTED/nodeenv/nodeenv-1.7.0-py2.py3-none-any.whl (21 kB)
Collecting setuptools
  Downloading https://us-python.pkg.dev/REDACTED/setuptools/setuptools-66.1.1-py3-none-any.whl (1.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 5.5 MB/s eta 0:00:00
Installing collected packages: setuptools, nodeenv, pyright
ERROR: Could not install packages due to an OSError.
Check the permissions.
Traceback (most recent call last):
  File "/home/USER/src/REDACTED/.server_bin.venv/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 494, in run
    installed = install_given_reqs(
  File "/home/USER/src/REDACTED/.server_bin.venv/lib/python3.9/site-packages/pip/_internal/req/__init__.py", line 73, in install_given_reqs
    requirement.install(
  File "/home/USER/src/REDACTED/.server_bin.venv/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 792, in install
    install_wheel(
  File "/home/USER/src/REDACTED/.server_bin.venv/lib/python3.9/site-packages/pip/_internal/operations/install/wheel.py", line 729, in install_wheel
    _install_wheel(
  File "/home/USER/src/REDACTED/.server_bin.venv/lib/python3.9/site-packages/pip/_internal/operations/install/wheel.py", line 589, in _install_wheel
    file.save()
  File "/home/USER/src/REDACTED/.server_bin.venv/lib/python3.9/site-packages/pip/_internal/operations/install/wheel.py", line 382, in save
    os.unlink(self.dest_path)
PermissionError: [Errno 13] Permission denied: '/home/USER/src/REDACTED/.server_bin.venv/lib/python3.9/site-packages/_distutils_hack/__init__.py'

Version

Development (host) and target OS/architectures:

Output of bazel --version: bazel 5.4.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

Local copy of a personal fork, specifically this branch: https://github.com/tellett/rules_py/tree/fix_venv_python_path

Also a forked version of rules_python (up to date w/ the latest release) to install GCP artifact registry connectivity dependencies, specifically I installed or updated the following dependencies:

requirement("importlib_metadata"),
requirement("zipp"),
requirement("more_itertools"),
requirement("cachetools"),
requirement("certifi"),
requirement("cffi"),
requirement("charset_normalizer"),
requirement("cryptography"),
requirement("google_auth"),
requirement("idna"),
requirement("jaraco.classes"),
requirement("jeepney"),
requirement("keyring"),
requirement("keyrings.google_artifactregistry_auth"),
requirement("pluggy"),
requirement("pyasn1"),
requirement("pyasn1_modules"),
requirement("pycparser"),
requirement("requests"),
requirement("rsa"),
requirement("SecretStorage"),
requirement("six"),
requirement("urllib3"),

Language(s) and/or frameworks involved:

Python, FastAPI, PyTorch, GCP, etc.

How to reproduce

I believe this is above, if not please let me know and I'll provide more details or a sample repo.

Any other information?

No response

Fund our work

  • Sponsor our open source work by donating a bug bounty
@tellett tellett added the bug Something isn't working label Jan 20, 2023
@alexeagle alexeagle added this to the 1.0 milestone Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants