Repository: carla-simulator/carla

Issue #7975:  version `GLIBC_2.34' not found when import carla on client computer with lower version of Ubuntu system
Created: 2024-07-24T04:26:18Z
CARLA version: 0.9.14
Platform/OS: server: ubuntu22.04, client: ubuntu20.04/18.04
Problem you have experienced: I create .egg and .whl file in ubuntu22.04 in python3.7, and I want to use the egg file(or whl file) in another client computer(ubuntu20.04/ubuntu18.04, python3.7). I can use .egg file and .whl file in the server computer(ubuntu22.04). But when I use the .egg file or .whl file in cilent computer (ubuntu20.04/ubuntu18.04), is shows that "ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /root/.cache/Python-Eggs/carla-0.9.14-py3.7-linux-x86_64.egg-tmp/carla/libcarla.cpython-37m-x86_64-linux-gnu.so)"
What you expected to happen: The process of import carla should be executed correctly without errors.
Steps to reproduce: described in the problem part
Other information (documentation you consulted, workarounds you tried):  I found that it is OK to use the .whl file in ubuntu18.04 if the .whl file is generated in 20.04. I don't know why.
So the key question is can I use the .whl or .egg file in the cilent with a different ubuntu version. Or this is because I did something wrong.

Duplicate issue #8013: Building PythonAPI Fails for Lower Python Version
Created: 2024-08-01T19:37:38Z
CARLA version: 0.9.15
Platform/OS: Ubuntu 22.04
Hi,
I've been able to build CARLA from source and package it on my platform using Ubuntu's default Python 3.10, but the packaged version does not work in a Ubuntu 20.04 environment with Python 3.8 (it requires libc6 v2.34 but the environment has libc6 v2.31). I wanted to resolve this by building and packaging CARLA using Python 3.8, so I've added Python 3.8 to my system and switch between the two versions using sudo update-alternatives --config python3, and have rebuilt UE4.26 using it (launches without any problems). However, when trying to build PythonAPI (after wiping the Build directory clean) using make PythonAPI I get the following error:
Util/BuildTools/Linux.mk:163: warning: overriding recipe for target 'downloadplugins'
Util/BuildTools/Linux.mk:142: warning: ignoring old recipe for target 'downloadplugins'
Setup.sh: boost-1.80.0-c10 already installed.
Setup.sh: rpclib-v2.2.1_c5-c10 already installed.
Setup.sh: gtest-1.8.1-c10 already installed.
Setup.sh: recast-c10 already installed.
Setup.sh: Libpng already installed.
Setup.sh: Xerces-c already installed.
Setup.sh: Eigen already installed.
Setup.sh: Sqlite already installed.
Setup.sh: PROJ already installed.
Setup.sh: Patchelf already installed.
Setup.sh: CARLA version 0.9.15-4-g5515d3fc4-dirty.
Setup.sh: Generating CMake configuration files.
Setup.sh: Success!
BuildLibCarla.sh: Building LibCarla "Client.Release" configuration.
ninja: no work to do.
[0/1] Install the project...
-- Install configuration: "Client"
BuildLibCarla.sh: Success!
BuildOSM2ODR.sh: Building OSM2ODR.
HEAD is now at 1835e1e9538 Remove logs
-- Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
-- CMAKE_BINARY_DIR: /home/goodi/Programs/CARLA/carla/Build/libosm2dr-build
-- CMAKE_SOURCE_DIR: /home/goodi/Programs/CARLA/carla/Build/libosm2dr-source
-- 
-- Platform: 
--     Host: Linux-6.5.0-45-generic x86_64
--     Target: Linux-6.5.0-45-generic x86_64
--     CMake: 3.22.1
--     CMake generator: Ninja
--     CMake build tool: /usr/bin/ninja
--     Compiler: Clang 10.0.1
-- 
-- Found Proj: /home/goodi/Programs/CARLA/carla/Build/proj-install/lib/libproj.a
-- Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB) 
-- Enabled features: Linux-6.5.0-45-generic x86_64 Clang 10.0.1 Release Proj
-- Configuring done
-- Generating done
-- Build files have been written to: /home/goodi/Programs/CARLA/carla/Build/libosm2dr-build
ninja: no work to do.
[0/1] Install the project...
-- Install configuration: "Release"
-- Up-to-date: /home/goodi/Programs/CARLA/carla/PythonAPI/carla/dependencies/lib/libosm2odr.a
-- Up-to-date: /home/goodi/Programs/CARLA/carla/PythonAPI/carla/dependencies/include/OSM2ODR.h
/home/goodi/Programs/UnrealEngine_4.26/Engine/Source/ThirdParty/Linux/LibCxx/include/c++/v1
/home/goodi/Programs/UnrealEngine_4.26/Engine/Source/ThirdParty/Linux/LibCxx/lib/Linux/x86_64-unknown-linux-gnu
-- Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
-- CMAKE_BINARY_DIR: /home/goodi/Programs/CARLA/carla/Build/libosm2dr-build-server
-- CMAKE_SOURCE_DIR: /home/goodi/Programs/CARLA/carla/Build/libosm2dr-source
-- 
-- Platform: 
--     Host: Linux-6.5.0-45-generic x86_64
--     Target: Linux-6.5.0-45-generic x86_64
--     CMake: 3.22.1
--     CMake generator: Ninja
--     CMake build tool: /usr/bin/ninja
--     Compiler: Clang 10.0.1
-- 
-- Found Proj: /home/goodi/Programs/CARLA/carla/Build/proj-install-server/lib/libproj.a
-- Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB) 
-- Enabled features: Linux-6.5.0-45-generic x86_64 Clang 10.0.1 Release Proj
-- Configuring done
-- Generating done
-- Build files have been written to: /home/goodi/Programs/CARLA/carla/Build/libosm2dr-build-server
ninja: no work to do.
[0/1] Install the project...
-- Install configuration: "Release"
-- Up-to-date: /home/goodi/Programs/CARLA/carla/Unreal/CarlaUE4/Plugins/Carla/CarlaDependencies/lib/libosm2odr.a
-- Up-to-date: /home/goodi/Programs/CARLA/carla/Unreal/CarlaUE4/Plugins/Carla/CarlaDependencies/include/OSM2ODR.h
-- Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
-- CMAKE_BINARY_DIR: /home/goodi/Programs/CARLA/carla/Build/libosm2dr-build-server
-- CMAKE_SOURCE_DIR: /home/goodi/Programs/CARLA/carla/Build/libosm2dr-source
-- 
-- Platform: 
--     Host: Linux-6.5.0-45-generic x86_64
--     Target: Linux-6.5.0-45-generic x86_64
--     CMake: 3.22.1
--     CMake generator: Ninja
--     CMake build tool: /usr/bin/ninja
--     Compiler: Clang 10.0.1
-- 
-- Found Proj: /home/goodi/Programs/CARLA/carla/Build/proj-install-server/lib/libproj.a
-- Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB) 
-- Enabled features: Linux-6.5.0-45-generic x86_64 Clang 10.0.1 Release Proj
-- Configuring done
-- Generating done
-- Build files have been written to: /home/goodi/Programs/CARLA/carla/Build/libosm2dr-build-server
ninja: no work to do.
[0/1] Install the project...
-- Install configuration: "Release"
-- Up-to-date: /home/goodi/Programs/CARLA/carla/Unreal/CarlaUE4/Plugins/Carla/CarlaDependencies/lib/libosm2odr.a
-- Up-to-date: /home/goodi/Programs/CARLA/carla/Unreal/CarlaUE4/Plugins/Carla/CarlaDependencies/include/OSM2ODR.h
BuildOSM2ODR.sh:  OSM2ODR Success!
BuildPythonAPI.sh: Building Python API for Python 3.
setup.py:37: DeprecationWarning: distro.linux_distribution() is deprecated. It should only be used as a compatibility shim with Python's platform.linux_distribution(). Please use distro.id(), distro.version() and distro.name() instead.
  linux_distro = distro.linux_distribution()[0]
compiling:
  - source/libcarla/libcarla.cpp
running bdist_egg
running egg_info
writing source/carla.egg-info/PKG-INFO
writing dependency_links to source/carla.egg-info/dependency_links.txt
writing top-level names to source/carla.egg-info/top_level.txt
reading manifest file 'source/carla.egg-info/SOURCES.txt'
writing manifest file 'source/carla.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'carla.libcarla' extension
/home/goodi/Programs/UnrealEngine_4.26/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Idependencies/include -I/usr/include/python3.8 -c source/libcarla/libcarla.cpp -o build/temp.linux-x86_64-3.8/source/libcarla/libcarla.o -isystem dependencies/include/system -fPIC -std=c++14 -Werror -Wall -Wextra -Wpedantic -Wno-self-assign-overloaded -Wdeprecated -Wno-shadow -Wuninitialized -Wunreachable-code -Wpessimizing-move -Wold-style-cast -Wnull-dereference -Wduplicate-enum -Wnon-virtual-dtor -Wheader-hygiene -Wconversion -Wfloat-overflow-conversion -DBOOST_ERROR_CODE_HEADER_ONLY -DLIBCARLA_WITH_PYTHON_SUPPORT -stdlib=libstdc++ -DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=true
error: unable to open output file 'build/temp.linux-x86_64-3.8/source/libcarla/libcarla.o': 'Operation not permitted'
1 error generated.
error: command '/home/goodi/Programs/UnrealEngine_4.26/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang' failed with exit status 1
make: *** [Util/BuildTools/Linux.mk:92: PythonAPI] Error 1
I'd appreciate it if anyone knows how to resolve this issue.

Closing comment (2024-08-02T02:43:57Z): Ended up being an ownership issue, some folders within the bowels of CARLA had root owner, fixed it with sudo chown -R.
The original problem hasn't been solved though, similar to #7975  when I use import carla I get
Traceback (most recent call last):
  File "simbev.py", line 33, in <module>
    from carla_core import CarlaCore, kill_all_servers
  File "/home/simbev/carla_core.py", line 32, in <module>
    import carla
  File "<frozen zipimport>", line 259, in load_module
  File "/home/carla/PythonAPI/carla/dist/carla-0.9.15-py3.8-linux-x86_64.egg/carla/__init__.py", line 8, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/home/carla/PythonAPI/carla/dist/carla-0.9.15-py3.8-linux-x86_64.egg/carla/libcarla.py", line 7, in <module>
  File "/home/carla/PythonAPI/carla/dist/carla-0.9.15-py3.8-linux-x86_64.egg/carla/libcarla.py", line 6, in __bootstrap__
  File "/usr/lib/python3.8/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/sb/.cache/Python-Eggs/carla-0.9.15-py3.8-linux-x86_64.egg-tmp/carla/libcarla.cpython-38-x86_64-linux-gnu.so)