ImportError: No module named rospkg
I am using ROS kinetic on Ubuntu 16.04. When I typed this command, "roslaunch turtlebot_gazebo turtlebot_world.launch", the following error occurred. Please teach me how to solve it....
... logging to /home/yuki/.ros/log/fafca31c-4c63-11e7-a590-ac2b6eec753e/roslaunch-yuki-Inspiron-13-7368-13183.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
Traceback (most recent call last):
File "/opt/ros/kinetic/share/xacro/xacro.py", line 55, in <module>
import xacro
File "/opt/ros/kinetic/lib/python2.7/dist-packages/xacro/__init__.py", line 42, in <module>
from roslaunch import substitution_args
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 48, in <module>
import rospkg
ImportError: No module named rospkg
while processing /opt/ros/kinetic/share/turtlebot_gazebo/launch/includes/kobuki.launch.xml:
Invalid <param> tag: Cannot load command parameter [robot_description]: command [/opt/ros/kinetic/share/xacro/xacro.py '/opt/ros/kinetic/share/turtlebot_description/robots/kobuki_hexagons_asus_xtion_pro.urdf.xacro'] returned with code [1].
Param xml is <param command="$(arg urdf_file)" name="robot_description"/>
The traceback for the exception was written to the log file
As this is FAQ, you should be able to find many other threads that are already answered.
While the accepted answer should work around your issue, I've asked #q282982 as a more fundamental question.