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

Ubuntu VirtualEnv Creation can be configured to place python at bin/local/python, causes nox failure to find pip #642

Open
crwilcox opened this issue Aug 5, 2022 · 2 comments
Labels

Comments

@crwilcox
Copy link
Collaborator

crwilcox commented Aug 5, 2022

A user reported seeing this error to me. To be clear, the issue isn't in nox but instead in debian/virtualenv, but I wanted to open this so others that encounter this with nox can find the breadcrumbs.

TL;DR - you can set DEB_PYTHON_INSTALL_LAYOUT and revert to the previous way and you should be unblocked.

Error: python is not installed into the virtualenv, it is located at /usr/bin/python. Pass external=True into run() to explicitly allow this.

We spent some time digging, comparing configurations. Ultimately I requested they run virtualenv outside of nox.

https://askubuntu.com/questions/1406304/virtualenv-installs-envs-into-local-bin-instead-of-bin

This var, DEB_PYTHON_INSTALL_LAYOUT can be set and will allow virtualenv and nox to run as expected

export DEB_PYTHON_INSTALL_LAYOUT='deb'

Expected Behavior

Expect nox to create a virtualenv and successfully find pip, python, etc.

Environment

- OS: Linux (Debian Rodete)
- Python: 3.10.5
- Nox: 2022.1.7
- VirtualEnv:20.16.3
@crwilcox crwilcox added the bug label Aug 5, 2022
@crwilcox
Copy link
Collaborator Author

crwilcox commented Aug 5, 2022

I think pypa/virtualenv#2350 is related to this.

@crwilcox
Copy link
Collaborator Author

crwilcox commented Aug 5, 2022

Running sysconfig you can detect the issue

Fails

❯ python3.10 -m sysconfig

Platform: "linux-x86_64"
Python version: "3.10"
Current installation scheme: "posix_local"

Works

❯ python3.10 -m sysconfig

Platform: "linux-x86_64"
Python version: "3.10"
Current installation scheme: "posix_prefix"

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

No branches or pull requests

1 participant