Import error catkin_pkg while importing rosbag, roslib and rospy
I am novice to ROS and I followed the ROS installation tutorial to install ROS kinetic. After installing, I open python to import rospy, roslib and rosbag, but it throws the following error:
import roslib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/__init__.py", line 54, in <module>
import roslib.stacks
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/stacks.py", line 46, in <module>
import roslib.packages
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/packages.py", line 49, in <module>
from catkin.find_in_workspaces import find_in_workspaces as catkin_find
File "/opt/ros/kinetic/lib/python2.7/dist-packages/catkin/find_in_workspaces.py", line 36, in <module>
from catkin_pkg.packages import find_packages
ImportError: No module named catkin_pkg.packages
I again installed catkin_pkg using the following command but nothing happened:
sudo apt-get install --reinstall python-catkin-pkg
Can anyone suggest me where I am going wrong?
Please tell us how you installed ROS: using
apt-get
or building from sources, on which Linux distribution this is and which "ROS installation tutorial" you followed (link).Also: do you
source /opt/ros/kinetic/setup.bash
before starting thepython
interpreter?Yes I did source /opt/ros/kinetic/setup.bash and I followed the following link for installation: http://wiki.ros.org/kinetic/Installat...
Please post the output of
python -c "import catkin_pkg; print(catkin_pkg.__file__)"
.Thanks a lot, this link helped me https://answers.ros.org/question/1264... , particularly installing pip install catkin_pkg