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

No module named msg

asked 2017-04-11 12:37:37 -0600

mattMGN gravatar image


I am using an Arduino Uno with a Raspberry Pi on ROS indigo. When I run this command : rosrun rosserial_python

I don't understand why I get this error message :

pi@raspberrypi:~/catkin_ws/src $ rosrun rosserial_python

Traceback (most recent call last):

File "/home/pi/catkin_ws/src/rosserial/rosserial_python/nodes/", line 40, in <module> import rosserial_python

File "/home/pi/catkin_ws/devel/lib/python2.7/dist-packages/rosserial_python/__ init__ .py", line 35, in <module> exec(

File "<'string'>", line 1, in <'module'>

File "/home/pi/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/", line 47, in <'module'>

from rosserial_msgs.msg import *

ImportError : No module named msg

And I also don't understand where my script is looking for when running 'from rosserial_msgs.msg import*' line in python. In :

  • /home/pi/catkin_ws/src/rosserial/rosserial_msgs/msg

Or in :

  • /usr/local/lib/python2.7/dist-packages

Or somewhere else ?



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-04-12 01:11:33 -0600

updated 2017-04-12 01:20:00 -0600

Make sure that you have run catkin_make inside the catkin_ws directory. If you have already done that, I suspect that you have not added your catkin_ws in your bashrc. If you haven't, just run the following command:

echo "source /home/pi/catkin_ws/devel/setup.bash" >> /home/pi/.bashrc

Then close all terminals or run (on each open terminal):

source /home/pi/.bashrc
edit flag offensive delete link more


Thanks you very much. It works!

I missed >> /home/pi/.bashrc

mattMGN gravatar image mattMGN  ( 2017-04-12 02:31:23 -0600 )edit

Glad I helped! Don't forget to mark the question as solved, to help others too!

gstavrinos gravatar image gstavrinos  ( 2017-04-12 02:48:57 -0600 )edit

Question Tools

1 follower


Asked: 2017-04-11 12:37:37 -0600

Seen: 1,319 times

Last updated: Apr 12 '17