carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.59k stars 3.73k forks source link

[dev] `GLIBCXX_3.4.30' not found when using Python 3.10 egg and pygame #7862

Open Daraan opened 5 months ago

Daraan commented 5 months ago

I am using the current dev version of the simulator and the PythonAPI with Python 3.10

Since a few weeks I sometimes run into the error:

ImportError: /home/miniconda3/envs/leaderboard/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found
(required by /home/.cache/Python-Eggs/carla-0.9.15-py3.10-linux-x86_64.egg-tmp/carla/libcarla.cpython-310-x86_64-linux-gnu.so)

Code to reproduce(?) with python 3.10

Important: Add the carla.egg to the PYTHONPATH

>>> PYTHONPATH=$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.15-py3.10-linux-x86_64.egg:$PYTHONPATH python
import pygame
import carla

I could not reproduce this with the Python 3.7 egg file.

Temporary Solution:

Carla needs to be imported before pygame.

>>> PYTHONPATH=$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.15-py3.10-linux-x86_64.egg:$PYTHONPATH python
import carla
import pygame
PatrickPromitzer commented 5 months ago

Hi, it would be interesting to know if the same problem appears if you install the Carla package with pip.

pip install $CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.15-cp310-cp310-linux-x86_64.whl

or

path/to/python -m pip install $CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.15-cp310-cp310-linux-x86_64.whl
Daraan commented 5 months ago

Thank you for the reply. I realized some things:

Below are the pip freeze outputs.

Again two different observations

Broken environment (conda, python3.10, pygame & carla) auditwheel==6.0.0 bottle==0.12.25 carla @ file:///home/CARLA-0.9.15/PythonAPI/carla/dist/carla-0.9.15-cp310-cp310-linux_x86_64.whl#sha256=21b3ab3581e35b1859f2929f4003091b9e26fc06518e30719aa51996f19221f9 comm==0.2.2 debugpy==1.8.1 defusedxml==0.7.1 Glances==3.4.0.3 ipykernel==6.29.4 jupyter_client==8.6.2 jupyter_core==5.7.2 nest-asyncio==1.6.0 psutil==5.9.8 py3nvml==0.2.7 pyelftools==0.30 pygame==2.5.2 python-dateutil==2.9.0.post0 pyzmq==26.0.3 tornado==6.4.1 traitlets==5.14.3 tzdata==2023.3 ujson==5.9.0 xmltodict==0.13.0
Working environment addict==2.4.0 alabaster==0.7.16 antlr4-python3-runtime==4.9.3 argcomplete==3.2.2 asttokens==2.4.1 attrs==23.2.0 auditwheel==6.0.0 Babel==2.14.0 blinker==1.7.0 bottle==0.12.25 build==1.2.1 CacheControl==0.14.0 cachetools==5.3.3 catkin-pkg==1.0.0 certifi==2024.2.2 cffi==1.16.0 charset-normalizer==3.3.2 cleo==2.1.0 click==8.1.7 colcon-argcomplete==0.3.3 colcon-bash==0.5.0 colcon-cd==0.1.1 colcon-cmake==0.2.28 colcon-common-extensions==0.3.0 colcon-core==0.15.2 colcon-defaults==0.2.8 colcon-devtools==0.2.5 colcon-library-path==0.2.1 colcon-metadata==0.2.5 colcon-notification==0.2.15 colcon-output==0.2.13 colcon-package-information==0.3.3 colcon-package-selection==0.2.10 colcon-parallel-executor==0.3.0 colcon-pkg-config==0.1.0 colcon-powershell==0.4.0 colcon-python-setup-py==0.2.8 colcon-recursive-crawl==0.2.3 colcon-ros==0.4.1 colcon-test-result==0.3.8 colcon-zsh==0.5.0 colorlog==6.8.2 comm==0.2.2 ConfigArgParse==1.7 contourpy==1.2.0 coverage==7.4.1 crashtest==0.4.1 cryptography==42.0.7 cycler==0.12.1 dash==2.15.0 dash-core-components==2.0.0 dash-html-components==2.0.0 dash-table==5.0.0 debugpy==1.8.1 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.8 distro==1.9.0 docutils==0.20.1 dulwich==0.21.7 empy==3.3.4 exceptiongroup==1.2.0 executing==2.0.1 fastjsonschema==2.19.1 filelock==3.14.0 Flask==3.0.2 fonttools==4.49.0 future==0.18.3 Glances==3.4.0.3 hydra-colorlog==1.2.0 hydra-core==1.3.2 idna==3.6 imagesize==1.4.1 importlib-metadata==7.0.1 iniconfig==2.0.0 installer==0.7.0 ipykernel==6.29.4 ipython==8.21.0 ipywidgets==8.1.2 itsdangerous==2.1.2 jaraco.classes==3.4.0 jedi==0.19.1 jeepney==0.8.0 Jinja2==3.1.3 joblib==1.3.2 jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jupyter_client==8.6.2 jupyter_core==5.7.2 jupyterlab_widgets==3.0.10 keyring==24.3.1 kiwisolver==1.4.5 m2r2==0.3.3.post2 markdown-it-py==3.0.0 MarkupSafe==2.1.5 matplotlib==3.8.3 matplotlib-inline==0.1.6 mdit-py-plugins==0.4.0 mdurl==0.1.2 mistune==0.8.4 more-itertools==10.2.0 msgpack==1.0.8 mypy==1.9.0 mypy-extensions==1.0.0 myst-parser==2.0.0 nbformat==5.9.2 nest-asyncio==1.6.0 networkx==3.2.1 nose2==0.14.1 notify2==0.3.1 numpy==1.22.4 omegaconf==2.3.0 open3d==0.18.0 packaging==23.2 pandas==2.2.0 parso==0.8.3 pexpect==4.9.0 pillow==10.2.0 pkginfo==1.10.0 platformdirs==4.2.0 plotly==5.19.0 pluggy==1.4.0 poetry==1.8.3 poetry-core==1.9.0 poetry-plugin-export==1.8.0 prompt-toolkit==3.0.43 psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.2.2 py-trees==2.2.3 py3nvml==0.2.7 pycparser==2.22 pydot==2.0.0 pyelftools==0.30 pygame==2.5.2 pygccxml==2.4.0 Pygments==2.17.2 pyparsing==3.1.1 pyplusplus==1.8.5 pyproject_hooks==1.1.0 pyquaternion==0.9.9 pytest==8.0.0 pytest-cov==4.1.0 pytest-repeat==0.9.3 pytest-rerunfailures==13.0 python-dateutil==2.9.0.post0 pytz==2024.1 PyYAML==6.0.1 pyzmq==26.0.3 rapidfuzz==3.9.1 referencing==0.33.0 requests==2.31.0 requests-toolbelt==1.0.0 retrying==1.3.4 rpds-py==0.18.0 ruamel.yaml==0.18.6 ruamel.yaml.clib==0.2.8 scikit-learn==1.4.1.post1 scipy==1.12.0 SecretStorage==3.3.3 Shapely==1.6.4.post2 shellingham==1.5.4 six==1.16.0 snowballstemmer==2.2.0 Sphinx==7.2.6 sphinx-rtd-theme==2.0.0 sphinxcontrib-applehelp==1.0.8 sphinxcontrib-devhelp==1.0.6 sphinxcontrib-htmlhelp==2.0.5 sphinxcontrib-jquery==4.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.7 sphinxcontrib-serializinghtml==1.1.10 stack-data==0.6.3 tenacity==8.2.3 threadpoolctl==3.3.0 tomli==2.0.1 tomlkit==0.12.5 tornado==6.4.1 tqdm==4.66.2 traitlets==5.14.3 trove-classifiers==2024.5.17 typing_extensions==4.9.0 tzdata==2023.3 ujson==5.9.0 urllib3==2.2.1 virtualenv==20.26.2 wcwidth==0.2.13 Werkzeug==3.0.1 widgetsnbextension==4.0.10 xmltodict==0.13.0 zipp==3.17.0
PatrickPromitzer commented 5 months ago

I tested it with the pip package and it worked. After testing it with a .whl file, I got the same error message, but the order of carla/pygame didn't matter.

Try this commands

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install --only-upgrade libstdc++6

For me it worked after upgrading this package