ImportError: No module named rospkg
Hello,
I use Ubuntu 16.04 LTS, ROS Kinetic, and Anaconda. Python 3.6 is my default python. Now I'm following ROS Tutorials, particularly this part: http://wiki.ros.org/ROS/Tutorials/Und... .
So I wanna run this command:
$ rosrun rqt_graph rqt_graph
But I get this Error messages all the time,
rosrun rqt_graph rqt_graph
Traceback (most recent call last):
File "/opt/ros/kinetic/lib/rqt_graph/rqt_graph", line 5, in <module>
from rqt_gui.main import Main
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui/main.py", line 38, in <module>
import rospy
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in <module>
from .client import spin, myargv, init_node, \
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/client.py", line 52, in <module>
import roslib
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in <module>
from roslib.launcher import load_manifest
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in <module>
import rospkg
ModuleNotFoundError: No module named 'rospkg'
I've already installed ROS Packages with:
sudo apt-get install python-rospkg
And I get the same problem in venv as well. Thank you in advance for your answers. :)
The problem is probably due to Anaconda which requires you to modify your path. Search around on the site and you'll find many people with similar problems.
Yeah I found some similar problems, I think I'll just unistall anaconda then. It is the simplest solution.
I don't think that you have to uninstall Anaconda. You can probably just remove the line from your
.bashrc
file that adds Anaconda to your path. If you want to use Anaconda you can add it to your path manually. Keep in mind that I don't use Anaconda though.