ImportError: cannot import name ‘Respawn’ from ‘respawnGoal’ (ROS Noetic, Ubuntu 20)

asked 2022-04-20 19:02:12 -0500

Dhairya_Upadhyay gravatar image

updated 2022-04-30 13:40:28 -0500

lucasw gravatar image

Hi I am trying to run Machine Learning demos for ros noetic on Ubuntu 20 and I am getting this error. It is an import error but I am unable to figure out how to solve it. Please Help :

Traceback (most recent call last):
File “/home/dhairya/catkin_ws/devel/lib/turtlebot3_dqn/turtlebot3_dqn_stage_1”, line 15, in
exec(compile(fh.read(), python_script, ‘exec’), context)
File “/home/dhairya/catkin_ws/src/turtlebot3_machine_learning/turtlebot3_dqn/nodes/turtlebot3_dqn_stage_1”, line 30, in
from src.turtlebot3_dqn.environment_stage_1 import Env
File “/home/dhairya/catkin_ws/src/turtlebot3_machine_learning/turtlebot3_dqn/src/turtlebot3_dqn/environment_stage_1.py”, line 29, in
from respawnGoal import Respawn
ImportError: cannot import name ‘Respawn’ from ‘respawnGoal’ (/home/dhairya/catkin_ws/devel/lib/turtlebot3_dqn/respawnGoal.py)
[turtlebot3_dqn_stage_1-1] process has died [pid 10846, exit code 1, cmd /home/dhairya/catkin_ws/devel/lib/turtlebot3_dqn/turtlebot3_dqn_stage_1 __name:=turtlebot3_dqn_stage_1 __log:=/home/dhairya/.ros/log/d7fbc2d8-c0ff-11ec-a27a-fde6b6e903e0/turtlebot3_dqn_stage_1-1.log].
log file: /home/dhairya/.ros/log/d7fbc2d8-c0ff-11ec-a27a-fde6b6e903e0/turtlebot3_dqn_stage_1-1*.log
edit retag flag offensive close merge delete

Comments

Please provide a url for the ros package turtlebot3_machine_learning, or a link to a setup guide. At first glance, the error message hints that you have not installed required python libraries. Did you run rosdep after cloning this git repository?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-04-23 11:28:28 -0500 )edit

please how to add rosdep i got the same problem

jandisoon gravatar image jandisoon  ( 2022-11-03 08:25:20 -0500 )edit

@jandisoon Please provide the information requested in the first sentence of my above comment. The first thing we need to to verify is that this ros package has been ported to noetic & python3. There are significant differences between python2 and python3, so a lot of python2 code does not run in python3.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-11-03 09:30:27 -0500 )edit