Rosanswers logo


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 http://answers.ros.org/question/44669/fuerte-no-module-named-rospkg/

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

Help! :) Ruud

Originally posted by Ruud on ROS Answers with karma: 212 on 2015-07-01

Post score: 0


1 Answer 1


Rosanswers logo

I solved the issue by:

$ git clone git://github.com/ros/rospkg.git
$ sudo python setup.py install --user 

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

Originally posted by Ruud with karma: 212 on 2015-07-01

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by gvdhoorn on 2015-07-01:
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.

Comment by Ruud on 2015-07-02:
Yes I prefer to find the cause here. Currently it is fixed, but I did not learn a lot from it.. :)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.