Robotics StackExchange | Archived questions

ImportError: No module named xxxxxxx.msg

Hi everyone,

my question has two parts:

first part :

when I run the code from the terminal is Ok after this command:

catkin_ws$ source ~/catkin_ws/devel/setup.bash

but it needs to run this command every close and open again, how to solve this issue??

second part:

when I run the code from the spyder:

the output:

 ImportError: No module named xxxxxxx.msg

how to solve this issue??

I read from the previous questions and answers to other people, solving this problem by

gedit ~/.bashrc 

then

export ROS_PACKAGE_PATH=/home/redhwan/catkin_ws/:$ROS_PACKAGE_PATH

finally

source ~/catkin_ws/devel/setup.bash    & source ~/.bashrc 

not solve my issue

information system:

ubuntu 14.01

python 2.7

spyder 2.2.5

CUDA 0.9

path msg:

'/home/redhwan/catkin_ws/src/beginner_tutorials/msg/Num.msg'

please help me

thank you in advance

Asked by Redhwan on 2019-02-15 03:26:44 UTC

Comments

Having to source the workspace is not a bug, it's intended behaviour. Say you have multiple workspaces, you only want to source the one that's relevant to you right now. You could "solve it by adding the command to bashrc but I do not recommend it.

Asked by SleepyTurtle on 2019-02-15 04:33:43 UTC

With regards to the import error, you'll have to post the code you're tying to run.

Asked by SleepyTurtle on 2019-02-15 04:34:35 UTC

first of all, thank you so much @SleepyTurtle those msgs:

from cmvision.msg import Blobs, Blob

ImportError: No module named cmvision.msg

from cmvision_3d.msg import Blobs3d, Blob3d

ImportError: No module named cmvision_3d.msg

system indigo

Asked by Redhwan on 2019-02-23 01:01:05 UTC

Answers