Ask Your Question

No module named msg

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

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 -0500

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

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 -0500 )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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 844 times

Last updated: Apr 12 '17