Open3D
Open3D copied to clipboard
Conda Ubuntu 22.04 libstdc++.so.6: version `GLIBCXX_3.4.30' not found
Checklist
- [X] I have searched for similar issues.
- [X] For Python issues, I have tested with the latest development wheel.
- [X] I have checked the release documentation and the latest documentation (for
master
branch).
Steps to reproduce the issue
On Ubuntu 22.04 with Conda environment, the libstdc++.so
that comes with Conda may be older than the system's libstdc++
. When compiling Open3D with the system's gcc
, the compilation will work, but the import of Open3D python package may not work due to missing symbols (GLIBCXX_3.4.30
).
This is an upstream issue with the Conda environment. The proper fix is for Conda to include a newer libstdc++
in its distribution.
The temporary fix is to use the system's libstdc++
inside the Conda environment. We provide the temporary fix in the comments.
Error message
ImportError while importing test module '/home/user/repo/Open3D/python/test/data/test_data.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../miniconda3/envs/open3d/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
../python/test/data/test_data.py:27: in <module>
import open3d as o3d
../../../miniconda3/envs/open3d/lib/python3.9/site-packages/open3d/__init__.py:90: in <module>
from open3d.cpu.pybind import (camera, data, geometry, io, pipelines,
E ImportError: /home/user/miniconda3/envs/open3d/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/user/repo/Open3D
/build/lib/RelWithDebInfo/libOpen3D.so)
### Open3D, Python and System information
```markdown
- Operating system: Ubuntu 22.04
- Python version: Python 3.8
- System architecture: x86_64
Additional information
No response
- First, check your system's
libstdc++.so
version:
We can see that➜ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX GLIBCXX_3.4 GLIBCXX_3.4.1 GLIBCXX_3.4.2 GLIBCXX_3.4.3 GLIBCXX_3.4.4 GLIBCXX_3.4.5 GLIBCXX_3.4.6 GLIBCXX_3.4.7 GLIBCXX_3.4.8 GLIBCXX_3.4.9 GLIBCXX_3.4.10 GLIBCXX_3.4.11 GLIBCXX_3.4.12 GLIBCXX_3.4.13 GLIBCXX_3.4.14 GLIBCXX_3.4.15 GLIBCXX_3.4.16 GLIBCXX_3.4.17 GLIBCXX_3.4.18 GLIBCXX_3.4.19 GLIBCXX_3.4.20 GLIBCXX_3.4.21 GLIBCXX_3.4.22 GLIBCXX_3.4.23 GLIBCXX_3.4.24 GLIBCXX_3.4.25 GLIBCXX_3.4.26 GLIBCXX_3.4.27 GLIBCXX_3.4.28 GLIBCXX_3.4.29 GLIBCXX_3.4.30 GLIBCXX_DEBUG_MESSAGE_LENGTH
GLIBCXX_3.4.30
is indeed there. - Activate your Conda environment.
- Create symbolic link to the system's
libstdc++.so
.
Now, the libs should look like this:➜ cd $CONDA_PREFIX/lib ➜ mv libstdc++.so.6 libstdc++.so.6.old ➜ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
➜ cd $CONDA_PREFIX/lib ➜ ls -alh libstdc++* libstdc++.so -> libstdc++.so.6.0.29 libstdc++.so.6 -> /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6.0.29 libstdc++.so.6.old -> libstdc++.so.6.0.29
Reference: https://stackoverflow.com/a/73708979/1255535.
After changing I got a problem with undefined symbol: cusolverDnSetStream
thanks, it works for me
Thanks, worked for me too. Ubuntu 24.04, Anaconda 4.14.0
First, check your system's
libstdc++.so
version:➜ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX GLIBCXX_3.4 GLIBCXX_3.4.1 GLIBCXX_3.4.2 GLIBCXX_3.4.3 GLIBCXX_3.4.4 GLIBCXX_3.4.5 GLIBCXX_3.4.6 GLIBCXX_3.4.7 GLIBCXX_3.4.8 GLIBCXX_3.4.9 GLIBCXX_3.4.10 GLIBCXX_3.4.11 GLIBCXX_3.4.12 GLIBCXX_3.4.13 GLIBCXX_3.4.14 GLIBCXX_3.4.15 GLIBCXX_3.4.16 GLIBCXX_3.4.17 GLIBCXX_3.4.18 GLIBCXX_3.4.19 GLIBCXX_3.4.20 GLIBCXX_3.4.21 GLIBCXX_3.4.22 GLIBCXX_3.4.23 GLIBCXX_3.4.24 GLIBCXX_3.4.25 GLIBCXX_3.4.26 GLIBCXX_3.4.27 GLIBCXX_3.4.28 GLIBCXX_3.4.29 GLIBCXX_3.4.30 GLIBCXX_DEBUG_MESSAGE_LENGTH
We can see that
GLIBCXX_3.4.30
is indeed there.Activate your Conda environment.
Create symbolic link to the system's
libstdc++.so
.➜ cd $CONDA_PREFIX/lib ➜ mv libstdc++.so.6 libstdc++.so.6.old ➜ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
Now, the libs should look like this:
➜ cd $CONDA_PREFIX/lib ➜ ls -alh libstdc++* libstdc++.so -> libstdc++.so.6.0.29 libstdc++.so.6 -> /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6.0.29 libstdc++.so.6.old -> libstdc++.so.6.0.29
Reference: https://stackoverflow.com/a/73708979/1255535.
Thanks, this works!
One thing worth noticed is that don't forget to install six
for mujoco-based environments
Thanks, it works for me!