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

ImportError: No module named genmsg.template_tools

asked 2013-04-05 10:42:35 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Using Kubuntu 12.04, Kernel 3.2.0-40-generic, installed ROS Groovy ros_comm version 1.9.44. I've tried several times to install Groovy into a VMware Image and on a pure machine. Trying to start the catkin build in Eclipse Juno (started from a bash window), i've got:

/usr/bin/make all /usr/bin/cmake -H/home/martin/catkin_ws/src -B/home/martin/catkin_ws/build --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /home/martin/catkin_ws/build/CMakeFiles /home/martin/catkin_ws/build/CMakeFiles/progress.marks /usr/bin/make -f CMakeFiles/Makefile2 all make[1]: Betrete Verzeichnis '/home/martin/catkin_ws/build' /usr/bin/make -f chatter_msgs/CMakeFiles/chatter_msgs_gencpp.dir/build.make chatter_msgs/CMakeFiles/chatter_msgs_gencpp.dir/depend make[2]: Betrete Verzeichnis '/home/martin/catkin_ws/build' cd /home/martin/catkin_ws/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/martin/catkin_ws/src /home/martin/catkin_ws/src/chatter_msgs /home/martin/catkin_ws/build /home/martin/catkin_ws/build/chatter_msgs /home/martin/catkin_ws/build/chatter_msgs/CMakeFiles/chatter_msgs_gencpp.dir/DependInfo.cmake --color= make[2]: Verlasse Verzeichnis '/home/martin/catkin_ws/build' /usr/bin/make -f chatter_msgs/CMakeFiles/chatter_msgs_gencpp.dir/build.make chatter_msgs/CMakeFiles/chatter_msgs_gencpp.dir/build make[2]: Betrete Verzeichnis '/home/martin/catkin_ws/build' /usr/bin/cmake -E cmake_progress_report /home/martin/catkin_ws/build/CMakeFiles 1 [ 14%] Generating C++ code from chatter_msgs/Chatter.msg cd /home/martin/catkin_ws/build/chatter_msgs && ../catkin_generated/ /usr/bin/python /opt/ros/groovy/lib/gencpp/ /home/martin/catkin_ws/src/chatter_msgs/msg/Chatter.msg -Ichatter_msgs:/home/martin/catkin_ws/src/chatter_msgs/msg -Istd_msgs:/opt/ros/groovy/share/std_msgs/msg -p chatter_msgs -o /home/martin/catkin_ws/devel/include/chatter_msgs -e /opt/ros/groovy/share/gencpp Traceback (most recent call last): make[2]: Verlasse Verzeichnis '/home/martin/catkin_ws/build' File "/opt/ros/groovy/lib/gencpp/", line 41, in <module> import genmsg.template_tools ImportError: No module named genmsg.template_tools make[2]: * [/home/martin/catkin_ws/devel/include/chatter_msgs/Chatter.h] Fehler 1 make[1]: Verlasse Verzeichnis '/home/martin/catkin_ws/build' make[1]: [chatter_msgs/CMakeFiles/chatter_msgs_gencpp.dir/all] Fehler 2 make: ** [all] Fehler 2

Does anybody know why? (I never programmed python)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-01-21 03:39:47 -0500

Jun Su gravatar image

I think you need to add the PYTHONPATH variable to eclipse. Project > Properties > C/C++ Build > Environment

The value should be /opt/ros/hydro/lib/python2.7/dist-packages. Can use "export | grep PYTHONPATH" to check your value.

edit flag offensive delete link more


Worked for me as well on Ubuntu 14.04 and ROS Indigo, thanks!

eliasm gravatar image eliasm  ( 2014-11-26 13:02:20 -0500 )edit

Question Tools

1 follower


Asked: 2013-04-05 10:42:35 -0500

Seen: 3,735 times

Last updated: May 02 '14