ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

carla-ros-bridge error due to Python?

asked 2020-04-09 19:27:39 -0600

JoloGermanAg gravatar image

updated 2020-04-10 12:03:36 -0600

Howdy, following error when running

$ roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle
Traceback (most recent call last):
  File "/opt/carla-ros-bridge/melodic/lib/carla_ros_bridge/", line 25, in <module>
    from import Actor
  File "/opt/carla-ros-bridge/melodic/lib/python2.7/dist-packages/carla_ros_bridge/", line 19, in <module>
    import carla_ros_bridge.transforms as trans
  File "/opt/carla-ros-bridge/melodic/lib/python2.7/dist-packages/carla_ros_bridge/", line 16, in <module>
    import tf
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf/", line 30, in <module>
    from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/", line 38, in <module>
    from tf2_py import *
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_py/", line 38, in <module>
    from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)

From what little info i found it seems to be an incompatibility between python2 and python3 but I am not sure how to fix this. Also, it's not saving the log file so that's why i didnt attach that

Installation was done following the instructions on gitlab!

edit retag flag offensive close merge delete


Hi @JoloGermanAg

I am trying to set up Carla as well. Can you please provide the link to the instructions you have followed to set up Carla simulator to work with Autoware?

Thank you!

omkard gravatar image omkard  ( 2020-04-11 18:34:51 -0600 )edit

Here it is:

Just make sure that you are have downloaded and installed the Master branch for Autoware as these specific instructions are a recent addition/upgrade as far as I understand.

JoloGermanAg gravatar image JoloGermanAg  ( 2020-04-11 20:43:23 -0600 )edit

Thank you very much !! @JoloGermanAg

omkard gravatar image omkard  ( 2020-04-12 16:32:30 -0600 )edit

Hi @JoloGermanAg,

I am getting the following error. Please advise.

image description

omkard gravatar image omkard  ( 2020-04-13 11:43:27 -0600 )edit

did you follow the instructions and install carla? The first one suggests that you may be using an older version of autoware that does not include the autoware bridge yet. go to (PathToAutoware)/install/carla_autoware_bridge. If it;s not there you need to reinstall autoware from the newest (master/bleeding edge) branch. The second one is missing the .launch at the end

JoloGermanAg gravatar image JoloGermanAg  ( 2020-04-13 14:01:43 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2020-04-11 18:07:55 -0600

JoloGermanAg gravatar image

Fixed it, for some reason the default was changed to python 3.6 instead of 2.7.

edit flag offensive delete link more

answered 2020-07-29 08:03:13 -0600

jester gravatar image

updated 2020-07-29 08:06:57 -0600

I think that you installed the wrong python .egg file...

There are 2 ways:

  1. Expand your .bashrc with the Pythonpath:

    export CARLA_ROOT=~/CARLA_0.9.8
    export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/dist/carla-0.9.8-py2.7-linux-x86_64.egg:${CARLA_ROOT}/PythonAPI/carla/agents:${CARLA_ROOT}/PythonAPI/carla
  2. Install the right .egg file

    pip uninstall carla or pip3 uninstall carla

    python easy_install -m carla-0.9.8-py2.7-linux-x86_64.egg


    python easy_install -m carla-0.9.8-py3.6-linux-x86_64.egg
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-04-09 19:27:39 -0600

Seen: 1,675 times

Last updated: Jul 29 '20