uv: [bug] Can't build Rust extensions via `pyo3` if using a `uv`-managed Python interpreter
When building the extension, the following error occurs (omitting the prefixes of some paths):
dyld[90807]: Library not loaded: /install/lib/libpython3.13.dylib
Referenced from: <A73153CF-70A5-379B-B9D3-526153D8322F> repro/target/debug/deps/setup-29f3c899bfb488ef
Reason: tried: '/install/lib/libpython3.13.dylib' (no such file), 'repro/target/debug/deps/libpython3.13.dylib' (no such file), 'repro/target/debug/libpython3.13.dylib' (no such file), '.rustup/toolchains/stable-aarch64-
apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpython3.13.dylib' (no such file), '.rustup/toolchains/stable-aarch64-apple-darwin/lib/libpython3.13.dylib' (no such file), '/Users/luca/lib/libpyt
hon3.13.dylib' (no such file), '/usr/local/lib/libpython3.13.dylib' (no such file), '/usr/lib/libpython3.13.dylib' (no such file, not in dyld cache)
error: test failed, to rerun pass `--lib
This is on macOS, using the latest Rust toolchain and uv build. I uploaded a reproduction repository to help with the investigation.
I originally suspected this to be an issue with sysconfig, but it appears to be configured correctly:
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 30 (30 by maintainers)
Happy to give it a try—any pointer as to where I should be looking at for the installation phase?
tada
I guess we should try to do that at install time.
I’d have to be
target/debug(for adebugbuild). The top-leveltargetdirectory it’s indeed not in the search path by default.