-
Notifications
You must be signed in to change notification settings - Fork 125
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
RuntimeError: Virtual environment creation failed, executable /usr/local/bin/python missing #215
Comments
What folder are you running this in? |
A subfolder of |
How did you install Python? It looks like |
Using default Python on MacOS 11.1 here. Hm... |
macOS 11.1 does not have a default Python. (Well, technically there is, but it’s not usable in user land, and certainly not located at |
Then I have no idea. It resides in
|
I wonder if
|
I played around with it a little more and I'd say this is too hard to figure out remotely. Thanks anyways for your help! I'll post a solution when I found one. |
@nschloe were you doing this on an M1 Mac? i ran into this issue last night on an M1 Mac, but ran fine when i tried on an Intel Mac. |
It's an old Intel MacBook Air, but fully upgraded (Big Sur 11.1). |
I am encountering a similar issue on Ubuntu 20.04.3 LTS using Python 3.10, which I installed from the deadsnakes PPA.
If, instead, I use Python 3.9, also installed from the deadsnakes PPA, |
It looks like the prefix scheme is changed to +_INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_prefix'] so venvs are created using a different scheme. |
We could add another condition here to check for the existence of the |
Wait, this is the stdlib venv... so something else is going on. Oh right, of course, the venv module doesn't use sysconfig, so deadsnakes would need to patch venv if they are using an incompatible default scheme. Please report this to deadsnakes. |
@layday As is tracked above, I have reported the issue to deadsnakes, but the developer there believes it is actually related to |
Yes, venvs are created "correctly". The issue is that we cannot extract the venv paths if a different scheme is used for the venv because we operate on the assumption that the system default and the venv schemes are the same. That is how venvs have historically worked and it's how they are supposed to work. If Debian or deadnakes or Fedora or whoever wish to deviate from the spec, they need to put in the effort to make sure their changes are compatible with the wider ecosystem. |
Can you actually |
Thanks for your help @layday. Does the following change anything to your argument?
|
I assume pip calls |
Do you mind checking the latest reply from the deadsnakes developer? The thread is tracked above. |
We create venvs programmatically. We do not know where the venv Python is located, or where any of the other paths are located inside the venv, which is why we are calling |
A workaround would be go install build[virtualenv], I think that would not have this issue 🤔 |
The developer at deadsnakes is wondering if an approach similar to this one could work for |
I mentioned that as a possibility earlier. I do think it's the wrong way to approach altering the venv scheme. If a different scheme is sought for venvs, a new entry should be added to the preferred scheme dict, for venvs. |
Requiring @layday, can you try to engage the Debian developers (and/or any relevant parties) to see if this can be fixed? This is likely still fixable, since AFAIK it's only shipped to deadsnakes and probably Debian unstable. |
The behavior is technically correct on Python 3.9 and older, it only becomes a problem when distributors break assumptions and change the install layout, which is not supported by the Python upstream. However, this becomes an issue in 3.10 as the Python upstream provides an official mechanism to customize the install layout. Using the We can use the The deadsnakes developer can adopt the same approach of specifying the See https://bugs.python.org/issue45413 for more details. |
That was proposed in #434 python/cpython#31034 is the CPython PR that adds it -- if merged, others can start using it soon (it should even fix macOS Python once they update to 3.11) |
deadsnakes now defines the |
Yes, deadsnakes implementation is what prompted the discussion.
Sent with [ProtonMail](https://protonmail.com/) Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Monday, January 31st, 2022 at 18:21, Miro Hrončok ***@***.***> wrote:
deadsnakes now defines the "venv" installation scheme as well: ***@***.***(deadsnakes/python3.10@9b93d73)
—
Reply to this email directly, [view it on GitHub](#215 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AHNRFWEFC5SLDFDFMAMAE33UY2ZJHANCNFSM4WXKMP2A).
Triage notifications on the go with GitHub Mobile for [iOS](https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or [Android](https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thank you for this, I was following the Python packaging documentation ( https://packaging.python.org/en/latest/tutorials/packaging-projects/ ) and got stuck with a similar error message, this was the first google hit on a search for it, and installing build[virtualenv] solved my problem. |
same thing here... we are told python3 setup.py bdist_wheel is "obsolete" and to use pythom -m build...
|
Hmm, wonder if it's only making python3 instead of python? venv isn't supposed to do that, but maybe it's been hacked a bit? FYI, build works fine on stock Ubuntu 22.04 in a docker container: $ docker run --rm -it ubuntu:22.04
# apt update && apt install -y python3-venv python3-pip git
# git clone https://github.com/pypa/build
# cd build/
# python3 -m pip install build
# python3 -m build --wheel
* Creating venv isolated environment...
* Installing packages in isolated environment... (flit-core >= 3.4)
* Getting build dependencies for wheel...
* Building wheel...
Successfully built build-0.9.0-py3-none-any.whl |
Ahah, the |
As a workaround you can install |
I found: https://bugs.launchpad.net/ubuntu/+source/python-build/+bug/1992108 with quick fix |
* Build also needs venv to be explicitly installed * Install build via pip as the Jammy package is broken As per pypa/build#215 (comment) and https://bugs.launchpad.net/ubuntu/+source/python-build/+bug/1992108 * Use dash-compatible = instead of bash-specific == Incidental trivial improvement in several other source files: fix spacing in strings broken over multiple lines.
When running
on Mac OS, I'm getting
Not sure at all whe it would be looking for python in
/usr/local
. Any idea what's going wrong?The text was updated successfully, but these errors were encountered: