Skip to content
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

Linker error in exercise 01_setup #6

Open
tvijverb opened this issue Jul 31, 2024 · 2 comments
Open

Linker error in exercise 01_setup #6

tvijverb opened this issue Jul 31, 2024 · 2 comments

Comments

@tvijverb
Copy link

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 ;)

@tvijverb
Copy link
Author

Renaming libpython3.12.so to libpython3.12.so.1.0 in the target/debug folder fixed the issue for me

@LukeMathWalker
Copy link
Collaborator

Renaming libpython3.12.so to libpython3.12.so.1.0 in the target/debug folder fixed the issue for me

That's indeed the issue, I wonder why it's adding that prefix 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants