Module not found error with rospkg when trying to import roslib
Hello,
I have developed a custom control algorithm for mz robot in gazebo. Untile yesterday I used to use
roslaunch spider_gazebo spider_world.launch
to spawn the robot and load control configurations in gazebo and then in another terminal i used to export ROS_MASTER_URI and then use
rosrun spider_control control.py
to run my custom python plugin. Until yesterday this was working well, but today when I tried to launch again `I am having the following error
'Traceback (most recent call last):
File "/home/microbot/catkin_ws/src/spider/spider_control/control.py", line 5, in <module>
import roslib
File "/opt/ros/melodic/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in <module>
from roslib.launcher import load_manifest
File "/opt/ros/melodic/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in <module>
import rospkg
ModuleNotFoundError: No module named 'rospkg'
I have also tried the following command to check whether my python path is right or not ,
'echo $PYTHONPATH'
The output is
'/home/microbot/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/melodic/lib/python2.7/dist-
packages:/opt/ros/melodic/share/ros/core/roslib/src
I can not understand whats causing this error. can any one please help me point out the reason. Thanks