ImportError: No module named xxxxxxx.msg

asked 2019-02-15 02:26:44 -0600

Redhwan gravatar image

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

edit retag flag offensive close merge delete

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.

SleepyTurtle gravatar image SleepyTurtle  ( 2019-02-15 03:33:43 -0600 )edit

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

SleepyTurtle gravatar image SleepyTurtle  ( 2019-02-15 03:34:35 -0600 )edit

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

Redhwan gravatar image Redhwan  ( 2019-02-23 00:01:05 -0600 )edit