-
-
Notifications
You must be signed in to change notification settings - Fork 133
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]: venv
creation fails on linux-musl
builds
#261
Comments
works fine here (mise latest, python 3.12.3, ubuntu 24) |
This happens to me as well (also: mise latest, python 3.12.3, ubuntu 24.04)
digging deeper:
This also happens if I install a (precompiled) 3.11. So I don't know what's going on. But it's a real problem! |
I wonder whether #262 is related. I suspect it is, since the issue seems to be: the venv for Poetry can't be installed. |
[edited] For me:
ok, not sure if
This is using the bundled pip wheel in the same way the pip installation phase in venv creation seems to... and comes to the same end? |
heyyyy I think this old bug is related! In python-build-standalone there's a patch to the linux cpython build which exists to work around an issue that was never properly fixed where a non-dynamically-linked Python couldn't bootstrap pip: diff --git a/pip/_internal/utils/glibc.py b/pip/_internal/utils/glibc.py
index 819979d80..4ae91e364 100644
--- a/pip/_internal/utils/glibc.py
+++ b/pip/_internal/utils/glibc.py
@@ -47,7 +47,10 @@ def glibc_version_string_ctypes():
# manpage says, "If filename is NULL, then the returned handle is for the
# main program". This way we can let the linker do the work to figure out
# which libc our process is actually using.
- process_namespace = ctypes.CDLL(None)
+ try:
+ process_namespace = ctypes.CDLL(None)
+ except OSError:
+ return None
try:
gnu_get_libc_version = process_namespace.gnu_get_libc_version
except AttributeError: That lives on BUT apparently doesn't apply to the
Note the lack of any try/except around the
My question is how does this ever work? Clearly it works for @mustafa0x and for that matter used to work for me until recently. Is there some odd path I and @yozachar both followed that leads to us tripping over this pothole? |
On a different computer I have access to, I don't see this problem, and the difference appears to be that the precompiled Python that |
OK, I think this bug should be retitled: " There is a DIFFERENT question which is: why is |
venv
creation failsvenv
creation fails on linux-musl
builds
Thanks @egnor, that makes sense to me. Is there anything to do in |
I guess the change would be... somehow apply that |
I think upstreaming that change would be the best thing! It's clearly a good robustness thing and afaik the only thing that stops pip from working on statically linked Python |
Yeah. It looks like there was some work on this in the context of python-build-standalone: pypa/pip#6543 (comment). I guess we'd need to change it in CPython, pip, and setuptools? I haven't dug deeper than reading that thread. |
I can try to submit a PR for this in pip. |
Yeah I'm not sure the full situation between pip, setuptools, ctypes (in cpython), etc, and it may have evolved since that thread. Certainly that specific patch seems... eminently good? |
And, there's no rush since most of us don't need to use the -musl version, and those of us who do don't usually need pip. |
Yeah, in python-build-standalone at least I only see that patch on pip, but I'll do some research. Thanks for all your help here. |
Ok, it looks like @indygreg actually did patch it in setuptools: pypa/packaging#294 |
Added in pypa/pip#12716. |
Ok, I added this in pip and it has now merged upstream; and we have a patch in |
I installed a standalone build with
mise
, but I'm unable to create virtual environments.Error
Info
What's wrong. How do I fix it?
The text was updated successfully, but these errors were encountered: