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

import tf error

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

MPR gravatar image

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

lucasw gravatar image

how to solve the issue?

import tf
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf/__init__.py", 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/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 38, in <module>
  File "/home/aimotion/catkin_ws/devel/lib/python3/dist-packages/tf2_py/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 38, in <module>
ImportError: dynamic module does not define module export function (PyInit__tf2)
edit retag flag offensive close merge delete

Comments

This is a repeat question, pls refer to: https://answers.ros.org/question/3262...

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

1 Answer

Sort by ยป oldest newest most voted
0

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

Mike Scheutzow gravatar image

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

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

Stats

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

Seen: 1,496 times

Last updated: Oct 27 '21