-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
libpython missing #6812
Comments
We are also encountering the same issue when trying to run pytriton within a |
I guess this is only an issue for the python-build-standalone binaries uv uses by default. If you let uv create the venv with a Python binary from another source, e.g. your system Python installation or one installed via pyenv, it works just fine because they don't have a shared library dependency on $ uv venv --python /usr/bin/python3 system-py-venv
...
$ ldd system-py-venv/bin/python
linux-vdso.so.1 (0x00007ffc870c9000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1233c94000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1233c75000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f1233c4a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1233a69000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1233d9f000) Judging by the sizes of these binaries (python-build-standalone: ~2 MB, pyenv/system: ~30 MB), I guess the latter just link libpython statically. So maybe uv should somehow find out whether the binary in question has a relative But this issue also messes with venvs created with python-build-standalone binaries independently of uv, so here's an issue on their side to maybe do something about it: |
Is this still an issue on latest uv, if you reinstall Python? |
I can confirm that the latest version solves this issue for us! 👍 Repro for testing which failed previously but now succeeds: Running this script with |
no it's not solved for me
|
|
This seems to be "as-designed" upstream https://bugs.python.org/issue43334#msg388720 |
Is there anything to resolve here then? Or na? |
Unless someone can point to comments contrary to what I linked, yeah I think our current behavior is correct. I guess the build system should handle resolving to the upstream binary? |
One small note here on something that surprised me:
This appears to be a bug in Notes on why the bug happens:
The problem with this implementation of
(On x86-64 the dynamic linker is at
The difference here is that when you invoke I wonder if fixing the bug in |
It seems that this issue was closed as not planned, which is fair enough. The only provider that offers this is conda. I have since moved on to using a more standard application environment manager - asdf, instead of uv. It also does not offer this functionality, but my workaround now is to find wherever these libraries are stored and link to there, or then copy them over to the python path. Unfortunate workaround :/ To your reply of which system is failing, I had a C++ project which tries to link to the python library. CMake build fails because it does not find the python path. It would not do this when the library is as stated in the post above, but also maybe I'm using the build system wrong. I'll update this post when I have time to get around to tinkering with that again. |
OK, I'd be curious to take a look when you get a chance. The standard CMake FindPython doesn't seem to have issues:
(This is on NixOS 24.05 stable inside Conda by its nature has its own environment implementation. I don't think uv should diverge from how upstream |
libpython should be left in the environment. This is useful for us developing c libraries with python bindings. And in fact python expects this as well (look at the
not found
line below):Right now, it is instead being put in:
${HOME}.local/share/uv/python/cpython-3.11.9-linux-x86_64-gnu/lib
, which is great for and speed, but super awful for portability. Maybe there can be a flag for this? I thought theuv venv --relocatable
flag would help, but it does not. Maybe a--portable
flag would be good for this?Thanks for the awesome tool otherwise!
The text was updated successfully, but these errors were encountered: