jordy-van-appeven/tello_driver

Ubuntu 20.04 and ROS Noetic -> ImportError: No module named rospkg

Opened this issue · 3 comments

Hi, I'm working on Ubuntu 20.04 and ROS Noetic. I want to install tello_driver but I get the following error message:

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.11
 * /tello/tello_driver_node/camera_calibration: /home/user...
 * /tello/tello_driver_node/connect_timeout_sec: 10.0
 * /tello/tello_driver_node/local_cmd_client_port: 8890
 * /tello/tello_driver_node/local_vid_server_port: 6038
 * /tello/tello_driver_node/stream_h264_video: True
 * /tello/tello_driver_node/tello_cmd_server_port: 8889
 * /tello/tello_driver_node/tello_ip: 192.168.10.1

NODES
  /tello/
    image_compressed (image_transport/republish)
    tello_driver_node (tello_driver/tello_driver_node)

auto-starting new master
process[master]: started with pid [35315]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to b96e7966-fc1d-11eb-befe-89052bf0da48
process[rosout-1]: started with pid [35325]
started core service [/rosout]
process[tello/tello_driver_node-2]: started with pid [35332]
process[tello/image_compressed-3]: started with pid [35333]
Traceback (most recent call last):
  File "/home/user/catkin_ws/src/tello_driver/nodes/tello_driver_node", line 2, 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
[tello/tello_driver_node-2] process has died [pid 35332, exit code 1, cmd /home/user/catkin_ws/src/tello_driver/nodes/tello_driver_node __name:=tello_driver_node __log:=/home/user/.ros/log/b96e7966-fc1d-11eb-befe-89052bf0da48/tello-tello_driver_node-2.log].
log file: /home/user/.ros/log/b96e7966-fc1d-11eb-befe-89052bf0da48/tello-tello_driver_node-2*.log


I've seen that ImportError: No module named rospkg is pretty well known and I've been reading through a lot of posts but most of the people either have problems with conda (which does not run on my machine) or with the python version (they changed the version from 2. to 3.). My python version is 3.8.10 so I don't think that there is the problem. Does anyone know what the problem could be? Help would be much appreciated.

The command below worked for me.
sudo pip install rospkg

perhaps, your node tries to start python and cant find it. try to change first line in :
sudo nano /opt/ros/noetic/lib/tello_driver/tello_driver_node.py
to looks like:
#! /usr/bin/env python3

@zoldaten Thanks it worked struggled for 3 hours