-
Notifications
You must be signed in to change notification settings - Fork 794
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
Python shared object not found while using pyenv #1576
Comments
Thanks for reporting. It's expected that you will need to set |
I've created this fn main() {
let home = std::env::var("HOME").expect("${HOME} is missing");
println!("cargo:rustc-env=LD_LIBRARY_PATH={home}/.pyenv/versions/3.11.2/lib");
} I found trying to use a cargo config with a home reference/variable wasn't resolving and I didn't want to hard-code the path. |
I used pyenv/pyenv#2647 (comment), inside .bashrc or .zshrc: for version in $(pyenv versions --bare)
do
export LD_LIBRARY_PATH="$(pyenv root)/versions/$version/lib:$LD_LIBRARY_PATH"
done |
My fix for this in VSCODE is updating {
"rust-analyzer.runnables.extraEnv": {
"LD_LIBRARY_PATH": "/home/anuvini/mambaforge/lib:$LD_LIBRARY_PATH"
}
} VSCODE did not respect my bashrc having the |
🐛 Python shared object not found while using pyenv
🌍 Environment
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.7.9
rustc --version
): rustc 1.51.0 (2fd73fabe 2021-03-23)version = "0.x.y"
withgit = "https://github.com/PyO3/pyo3")?
: yes💥 Reproducing
main.rs
cargo run
Result
error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
Workaround
The text was updated successfully, but these errors were encountered: