Rosanswers logo

I am running ROS kinetic and catkin_make works fine. Then several nodes start but two don't start. Error message:

File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_py/init.py", line 37, in from _tf2 import * ImportError: No module named '_tf2'

When I check the environment then I have there also /opt/ros/kinetic/lib/python2.7/dist-packages

Question is what I have to do to make it running? There is no module called '_tf2' that I could install.

Originally posted by AlexS on ROS Answers with karma: 1 on 2017-09-30

Post score: 0


1 Answer 1


Rosanswers logo

_tf2 is a compiled output of tf2_py which is the python wrapper of the core tf2 libray. You should make sure that tf2_py is either installed or built in your workspace and the installation directories are sourced.

Originally posted by tfoote with karma: 58457 on 2017-10-02

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by RosF110 on 2017-10-13:
Hi, how can I check the tf2_py was properly installed/built/sourced? Thanks a lot! I was following the steps shown at http://wiki.ros.org/tf/Tutorials/Introduction%20to%20tf, but at roslaunch turtle_tf turtle_tf_demo.launch I get only one turtle shown and ImportError: No module named '_tf2'.

Comment by azerila on 2020-07-02:
I have the same problem, but in my case once it is imported with no problem and once imedietly it gives the import error. I have described it here: https://github.com/hill-a/stable-baselines/issues/920

I'd be glad if anyone had any clue what I could try


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.