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

ImportError: No module named rospkg

asked 2015-07-01 02:26:04 -0600

Ruud gravatar image


I'm trying to compile a rospackage, but I throws the following error:

ImportError: No module named rospkg

I checked if it is installed:

sudo apt-get install python-rospkg -> python-rospkg is already the newest version.

dpkg -L python-rospkg -> /usr/lib/python2.7/dist-packages

And if that is in my python path:

echo $PYTHONPATH -> /home/ruud/Dropbox/ros/catkin_workspace/devel/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages:/usr/lib/pymodules/python2.7:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/rospkg:/usr/lib/python2.7/dist-packages

The problem looks very similar to

As far as I see 'rospkg' is not inside /usr/lib/pymodules/python2.7

Help! :) Ruud

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-07-01 02:51:31 -0600

Ruud gravatar image

I solved the issue by:

$ git clone git://
$ sudo python install --user

Apparently rospkg was not installed properly? Still not sure what is the cause though..

edit flag offensive delete link more



Hm. If at all possible, I'd avoid using distutils / setuptools to install rospkg. I've seen way too many installs (of ROS) freak out after some time. It's probably better (but more involved) to figure out why the debian pkg doesn't seem to be working for you.

gvdhoorn gravatar image gvdhoorn  ( 2015-07-01 03:57:57 -0600 )edit

Yes I prefer to find the cause here. Currently it is fixed, but I did not learn a lot from it.. :)

Ruud gravatar image Ruud  ( 2015-07-02 03:41:58 -0600 )edit

Question Tools

1 follower


Asked: 2015-07-01 02:26:04 -0600

Seen: 4,081 times

Last updated: Jul 01 '15