When I roslaunch my node, the error I receive is
ImportError: No module named rospy
But when I open up the python environment and run import rospy
, it imports successfully and I can access rospy.__file__
, which returns
/opt/ros/indigo/lib/python2.7/dist-packages/rospy/__init__.pyc
which is on my PYTHONPATH:
declare -x PYTHONPATH="/usr/lib/python2.7/dist-packages:/home/<user>/indigo_ws/devel/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages"
I do have a custom installation of Python that seems to have messed up some catkin_pkg installation, which is why it's had to be appended to the path. When I remove it to run roslaunch as a debug, I just get the same error.
Running Ubuntu 14.04 on a Raspberry Pi, if that helps.
Originally posted by djsw on ROS Answers with karma: 153 on 2016-01-06
Post score: 0
Original comments
Comment by Humpelstilzchen on 2016-01-08:
Did you check PYTHONPATH in os.environ? What version of the python interpreter is started by roslaunch?