Linker error in exercise 01_setup
tvijverb opened this issue · 2 comments
Hi Luke,
Thanks for creating this course, really nice to learn pyo3 concepts like this.
I've unfortunately run into an error when compiling the first maturin exercise 01_setup
with the wr
command.
/usr/bin/ld: cannot find -lpython3.12: No such file or directory
collect2: error: ld returned 1 exit status
error: linking with `cc` failed: exit status: 1
running the troubleshooting command given in the book (cargo run -p "patcher"
) causes a different error after running wr
:
/workspaces/rust-python-interoperability/target/debug/deps/setup-1d6fda427aa90d95: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory
error: test failed, to rerun pass `--lib`
System & OS details:
VSCode devcontainer using the following base-image: mcr.microsoft.com/devcontainers/rust:1-1-bookworm
OS: Debian Bookworm
Rust: 1.79.0
Rye: 0.37.0 (default options with `curl -sSf https://rye.astral.sh/get | bash`)
Platform: linux x64
Seems like Rye, Pyo3 and the Rust compiler are not playing nice ;)
Renaming libpython3.12.so
to libpython3.12.so.1.0
in the target/debug
folder fixed the issue for me
Renaming
libpython3.12.so
tolibpython3.12.so.1.0
in thetarget/debug
folder fixed the issue for me
That's indeed the issue, I wonder why it's adding that prefix 🤔