Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The accepted answer (as of Feb 2017) is outdated. Unless you need to customize, using binary is strongly recommended IMO. See the instruction on ros wiki http://wiki.ros.org/rospkg#Installing_rospkg

The accepted answer (as of Feb 2017) is outdated. Unless you need to customize, using binary is strongly recommended IMO. See the instruction on ros wiki http://wiki.ros.org/rospkg#Installing_rospkgwiki for how to install.

The accepted answer (as of Feb 2017) is outdated. Unless you need to customize, using binary is strongly recommended IMO. See the instruction on ros wiki for how to install.


UPDATE 2019-02-02: Looks like this is still a popular question. apt worked for 18.04 for me on a docker container that I just pulled from online.

$ docker pull ros:melodic-ros-core
melodic-ros-core: Pulling from library/ros
Digest: sha256:206a3a506cda320b525ef2cf2587726ee01451f470be4dfdd80cd20693840f27
Status: Image is up to date for ros:melodic-ros-core
$ docker run -it ros:melodic-ros-core /bin/bash

# apt-get purge python-rospkg && apt-get update && apt-get install -y ipython python-rospkg
:
Unpacking python-rospkg (1.1.7-100) ...
Setting up python-rospkg (1.1.7-100) ...

root@4a5281183177:/# ipython
:
In [1]: import rospkg
In [2]: rp = rospkg.RosPack()
In [3]: