File "/opt/ros/kinetic/bin/roslaunch", line 34, in <module> - ImportError: No module named roslaunch

asked 2016-11-14 06:44:18 -0500

updated 2016-11-16 06:18:43 -0500

I have been trying to use eclipse (Link) to debug my launch file. Launch file is working perfectly fine under ROS. However, when I try to use it under Eclipse, it does not work.

I get error like this,

Traceback (most recent call last):
 File "/opt/ros/kinetic/bin/roslaunch", line 34, in <module> import roslaunch
ImportError: No module named roslaunch

I don't know about line 34, and I definitely why it is giving me this error. I am particularly following the answer given here (link)

I have also checked suggestions given here in which it was mentioned that maybe I haven't configured my Environment Path. I am definitely using $ source devel/setup.bash whenever I go into my workspace. Output of

echo $ROS_PACKAGE_PATH

is

/home/catkin_ws:/home/khan/catkin_ws/src:/opt/ros/kinetic/share

So, I don't know whether it is an issue of environment or not. Please, help me in resolving this issue. Thanks in advance.

================================================================================== Edit 1: Nov. 16, 2016

I have no idea about Eclipse binary. I am simply following this link to configure C++ files with eclipse and this link to configure .luanch files.

If I run my eclipse, which I guess you meant from running my eclipse binary from bash session, (by using ./eclipse), I get this error

Usage: roslaunch [options] [package] <filename> [arg_name:=value...]
           roslaunch [options] <filename> [<filename>...] [arg_name:=value...]

If <filename> is a single dash ('-'), launch XML is read from standard input.

roslaunch: error: you must specify at least one input file

Thanks for your help.

edit retag flag offensive close merge delete

Comments

1

Just to make sure: you are starting the Eclipse binary from a bash session that has sourced the relevant setup.bash file?

I seem to remember that Eclipse (in it's launch configurations) overrides the PYTHONPATH variable. Perhaps that is what is causing you trouble?

gvdhoorn gravatar image gvdhoorn  ( 2016-11-16 05:55:25 -0500 )edit

Thank you so much gvdhoorn. I was anxiously waiting for your kind attention. I have edited my question based on your response. Please, put some light on it. Thanks.

Abdul Mannan gravatar image Abdul Mannan  ( 2016-11-16 06:13:39 -0500 )edit