-
Notifications
You must be signed in to change notification settings - Fork 244
[Bug]: ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory #710
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
Comments
Hey @StephenStrickland -- can you try |
Didn't work.
Relevant devbox.json: {
"packages": [
"python310",
"poetry",
"stdenv.cc.cc.lib"
],
} |
Did a little more testing, and I got a pytorch + gradio example (https://huggingface.co/spaces/gradio/pictionary/tree/main) to work using the following devbox.json {
"packages": [
"python310",
"python310Packages.pip",
"stdenv.cc.cc.lib"
],
"shell": {
"init_hook": [
"export LD_LIBRARY_PATH=`pwd`/.devbox/nix/profile/default/lib:/usr/wsl/lib:$LD_LIBRARY_PATH",
"source $VENV_DIR/bin/activate",
"pip install -r requirements.txt"
]
},
"nixpkgs": {
"commit": "f80ac848e3d6f0c12c52758c0f25c10c97ca3b62"
}
} The key here is the line I think we could automatically add the |
Going to close this issue in favor of #760, which we'll use to track the feature request of automatically setting the LD_LIBRARY_PATH variable. Thanks again for reporting! |
## Summary Adds `LD_LIBRARY_PATH` and `LIBRARY_PATH` env vars to shellenv (pointing to profile lib directory). This is a bit of a blunt approach, so not sure if it's best. This would fix #760 and also lets us simplify the [rust plugin](https://github.com/jetpack-io/devbox/blob/main/plugins/rustup.json#L7-L7) Two questions/considerations: * I considered adding to the flake.nix file instead, but wasn't example sure how to point to the right directory (without hard coding). It might look something like `LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath...` * I also read the following: > Not setting LD_LIBRARY_PATH is usually the right choice because usually the native binaries find their libraries using RUNPATH which is specific to the binary. Setting LD_LIBRARY_PATH has an obvious problem of potentially messing up other programs. @gcurtis any idea how accurate this is? ## How was it tested? `devbox shell` and confirmed env vars are set. Also tested with this example: #710 (comment)
Uh oh!
There was an error while loading. Please reload this page.
Current Behavior (bug)
When using python packages like
gradio
the package fails when calling intopandas
.Steps:
> devbox shell
> gradio
Error Message
Expected Behavior (fix)
Running
gradio
fromdevbox shell
should not return this error.This exact error message is listed as a quirk in Nix docs: https://nixos.wiki/wiki/Packaging/Quirks_and_Caveats#ImportError:_libstdc.2B.2B.so.6:_cannot_open_shared_object_file:_No_such_file
Additional context
machine: Windows 10 running Ubuntu WSL2
version:
0.4.1
./devbox.json
:./requirements.txt
:Note:
This bug is reproducible with
pip
andpoetry
. Baseddevbox.json
on example repos from docs.Workaround
devbox add python310Packages.pandas
The text was updated successfully, but these errors were encountered: