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

ImportError: No module named msg

asked 2012-03-27 02:03:18 -0500

fangyi gravatar image

updated 2014-01-28 17:11:45 -0500

ngrennan gravatar image

Hey, I'm a new ROS user and tried to use actionlib. I created a new package 'tuck_arms_server' and defined the message in .action file. After compiling the package, the msg folder is automatically created. But then my python code, I wanted to do this: "import from tuck_arms_server.msg import *", but I got the error: ImportError: No module named msg.

some relevant lines in my code: import roslib; roslib.load_manifest('tuck_arms_server');

in CMakeLists.txt:(just followed the tutorial)

rosbuild_find_ros_package(actionlib_msgs)
include(${actionlib_msgs_PACKAGE_PATH}/cmake/actionbuild.cmake)
genaction()

also added this line to the manifest file:

<depend package="actionlib_msgs"/>

So why cant it recognize msg in my package tuck_arms_server ? Thanks in advance.:-)

edit retag flag offensive close merge delete

Comments

1

You wrote "import from tuck_arms_server import *", which is not valid Python. Is that what you meant? (If not, you should probably edit the question)

Mac gravatar image Mac  ( 2012-04-09 09:35:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-05-26 07:46:25 -0500

this post is marked as community wiki

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

@Mac is right: Your import syntax is incorrect. Please see the rospy tutorials for correct syntax.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-03-27 02:03:18 -0500

Seen: 2,386 times

Last updated: May 26 '12