Solution 9
ModuleNotFoundError: No module named ‘rospkg’
Apr 3, 2022
Try to change the shebang (line 1) according to the python version your ROS distro works with:
For melodic or earlier: #!/usr/bin/env python2
For noetic or later: #!/usr/bin/env python3