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

import tf error

asked 2021-10-27 00:57:08 -0600

MPR gravatar image

updated 2021-10-27 07:24:07 -0600

lucasw gravatar image

how to solve the issue?

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 "/home/aimotion/catkin_ws/devel/lib/python3/dist-packages/tf2_ros/", line 34, in <module>
  File "<string>", line 38, in <module>
  File "/home/aimotion/catkin_ws/devel/lib/python3/dist-packages/tf2_py/", line 34, in <module>
  File "<string>", line 38, in <module>
ImportError: dynamic module does not define module export function (PyInit__tf2)
edit retag flag offensive close merge delete


This is a repeat question, pls refer to:

osilva gravatar image osilva  ( 2021-10-27 04:54:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-10-27 07:02:21 -0600

Mike Scheutzow gravatar image

updated 2021-10-27 07:07:30 -0600

With melodic you are expected to use python2. Before you build again, make sure you delete the top-level devel and build directories in your catkin_ws.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2021-10-27 00:57:08 -0600

Seen: 1,313 times

Last updated: Oct 27 '21