ImportError: No module named rospkg
Hello.
I am trying to execute an scrip for hw_interface, but in the roslaunch execution the following error emerges:
Traceback (most recent call last):
File "/home/pi/catkin_ws/src/kate_global/script/hwinterface_script_kate.py", line 11, in <module>
import rospy
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/__init__.py", line 49, in <module>
from .client import spin, myargv, init_node, \
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/client.py", line 52, in <module>
import roslib
File "/opt/ros/noetic/lib/python3/dist-packages/roslib/__init__.py", line 50, in <module>
from roslib.launcher import load_manifest # noqa: F401
File "/opt/ros/noetic/lib/python3/dist-packages/roslib/launcher.py", line 42, in <module>
import rospkg
ImportError: No module named rospkg
qt5ct: using qt5ct plugin
[KATE_interface-4] process has died [pid 17094, exit code 1, cmd /home/pi/catkin_ws/src/kate_global/script/hwinterface_script_kate.py __name:=KATE_interface __log:=/home/pi/.ros/log/99d73b08-bb8f-11ea-9c44-dca6326fbe0e/KATE_interface-4.log].
If I try to install rospkg with
sudo apt-get install python3-rospkg
It sais that is alredy installed:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-rospkg is already the newest version (1.2.8-100).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
So I don't know why is this happening. Any idea?
I am working on Debian 10 (64 bits) and ROS version Noetic.
Best regards. Alessandro
EDIT:
The output of echo $PYTHONPATH
is:
/home/pi/catkin_ws/devel/lib/python3/dist-packages:/opt/ros/noetic/lib/python3/dist-packages:/usr/local/lib
The first line of hwinterface_script_kate.py is:
#!/usr/bin/env python
whats the output of:
and how did you try to execute your script?
I would guess that the script you invoke
hwinterface_script_kate.py
contains a shebang line referencingpython
orpython2
. Can you please update the question with the first line of that script.I have alredy edited the question.