Carla ros bridge: ImportError: No module named util

hello, i face a error when run roslaunch carla_ros_bridge carla_ros_bridge.launch

Traceback (most recent call last):
  File "/home/zqw/carla-ros-bridge/catkin_ws/src/ros-bridge/carla_ros_bridge/src/carla_ros_bridge/", line 37, in <module>
    import carla
  File "/home/zqw/carla/PythonAPI/carla/dist/carla-0.9.10-py3.6-linux-x86_64.egg/carla/", line 8, in <module>
  File "/home/zqw/carla/PythonAPI/carla/dist/carla-0.9.10-py3.6-linux-x86_64.egg/carla/", line 9, in <module>
  File "/home/zqw/carla/PythonAPI/carla/dist/carla-0.9.10-py3.6-linux-x86_64.egg/carla/", line 3, in __bootstrap__
ImportError: No module named util

and i use carla 0.9.10 and Unreal 4.24.

Are you using ROS melodic? If you are using ROS melodic you need to add the Python2 egg file to your PYTHONPATH and not the Python3 egg file.

can you tell me how i get python2 egg files? i only has a python3 egg file in ./PythonAPI/carla/dist/carla-0.9.10-py3.6-linux-x86_64.egg, very thanks

I just realised you are using 0.9.10 package. I would recommend using instead ( Support for Python2 was dropped in 0.9.10 and added again in

hello, when i reset branch to and it also occur the same erro, and still generate python3 egg file.

Hi! What do you mean by “when a reset branch to”? Are you building CARLA from source?

If you are building the PythonAPI from source, you can build it for Python2 in the following way:

make PythonAPI ARGS="--python-version=2"

Also, you can target several python versions:

make PythonAPI ARGS="--python-version=2,3.7,3.6"

On the other hand, if you are using the package (you can download the package for CARLA here: you will find the egg files for both Python2 and Python3 in the directory: PythonAPI/carla/dist.

Then, you just need to add the Python2 egg file to the PYTHONPATH

very thanks and solved this problem