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

Using numpy with rospy tutorial - no module found

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

achus gravatar image

Hi,

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 numpy_listener.py Traceback (most recent call last):
File "/home/user/catkin_ws/src/numpy_tutorial/scripts/numpy_listener.py", 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?

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

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

Comments

Thanks for the reply. Those possibilities had already been ruled out. The issue was that I kept my script file numpy_listener.py 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 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 1,476 times

Last updated: Apr 24 '16