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

Using numpy with rospy tutorial - no module found

asked 2016-04-24 00:36:11 -0600

achus gravatar image


I am following this tutorial. In Step 3, when I tried to run the listener, it threw following error:

~/catkin_ws/src/numpy_tutorial$ rosrun numpy_tutorial Traceback (most recent call last):
File "/home/user/catkin_ws/src/numpy_tutorial/scripts/", line 7, in <module> from rospy.numpy_pkg import numpy_msg ImportError: No module named numpy_pkg

I tried to get the module and provide it to ros but to vain. Can anyone help me fix this, please?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-24 01:11:59 -0600

robopo gravatar image

There could be many reasons.

  • Make sure you have numpy installed. But it should be already.
  • Make sure you did in your catking_workspace catkin_make
  • Make sure you did source devel/setup.bash in every terminal where you want to use rosrun or etc.
  • Make sure roscore is running
edit flag offensive delete link more


Thanks for the reply. Those possibilities had already been ruled out. The issue was that I kept my script file in numpy_tutorials/scripts directory. Till then I believed that all .py scripts go in /scripts while all .cpp files go in /src. My bad! Thanks again.

achus gravatar image achus  ( 2016-04-24 06:22:27 -0600 )edit

Question Tools

1 follower


Asked: 2016-04-24 00:33:40 -0600

Seen: 1,457 times

Last updated: Apr 24 '16