tf2_ros ImportError: dynamic module does not define module export function (PyInit__tf2)

137 views Asked by At

I can't use tf2_ros library in my python code. I m using ros melodic.

    import tf2_ros
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>
    from tf2_py import *
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>
    from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)

I try to use tf2 library for python but i get import error. Just i need import tf2 library and i need use this library with python3 and ros melodic.

1

There are 1 answers

0
Saurav Rai On

Not sure which environment you are working on. Have you installed the tf2_ros library? If not then install using the following on Ubunutu

 install python-tf2-ros

Or if you are using anaconda environment then try this

conda install robostack::ros-melodic-tf2-ros