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

ImportError: No module named roslaunch

asked 2018-03-12 06:18:55 -0500

bear234 gravatar image

I just installed ROS1 base version from source in the directory: /home/mdc/ros_base/.

To finish the installation, I executed source /home/mdc/ros_base/install_isolated/setup.bash.

Then I execute the command printenv | grep 'ROS\|PYTHONPATH' to check the environment variables of ROS and here is the output:

ROS_ROOT=/home/mdc/ros_base/install_isolated/share/ros
ROS_PACKAGE_PATH=/home/mdc/ros_base/src/ros_comm/rosbag:/home/mdc/ros_base/install_isolated/share:/home/mdc/ros/install_isolated/share:/home/mdc/ros/src
ROS_MASTER_URI=http://localhost:11311
ROS_VERSION=1
ROSLISP_PACKAGE_DIRECTORIES=/home/mdc/ros_base/devel_isolated/rosbag/share/common-lisp:/home/mdc/ros/devel/share/common-lisp
ROS_DISTRO=kinetic
PYTHONPATH=/home/mdc/ros_base/devel_isolated/rosbag/lib/python2.7/dist-packages:/home/mdc/ros_base/install_isolated/lib/python2.7/dist-packages:/home/mdc/ros/install_isolated/lib/python2.7/dist-packages
ROS_ETC_DIR=/home/mdc/ros_base/install_isolated/etc/ros

Also, I execute which roslaunch and get the output as below:

/home/mdc/ros_base/install_isolated/bin/roslaunch

Now, my project is here: /home/mdc/catkin_ws/, so here is what I'm doing:

cd /home/mdc/catkin_ws
roslaunch ./src/mylaunch/launch/classic_mode.launch

But I get an error:

Traceback (most recent call last):
      File "/home/mdc/ros_base/install_isolated/bin/roslaunch", line 34, in <module>
        import roslaunch
    ImportError: No module named roslaunch

However, I checked the path: /home/mdc/ros_base/install_isolated/lib/python2.7/dist-packages, which has been set into PYTHONPATH as above and I saw there was a directory named roslaunch. I think this is exactly the module roslaunch, right? If so, why can't it find the module roslaunch?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-03-12 06:56:07 -0500

plz execute source /opt/ros/distro/setup.bash fristly

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-03-12 06:18:55 -0500

Seen: 918 times

Last updated: Mar 12 '18