ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ImportError: No module named queue

asked 2020-09-21 23:47:11 -0600

weterpellman gravatar image

In the Hello World tutorial: When trying to initialize rosserial with rosrun rosserial_python /dev/ttyACM0 I get: "ImportError: No module named queue." Any idea what's going on here? ROS Melodic on Ubuntu Bionic

edit retag flag offensive close merge delete


I got this problem too, there seems to be very limited answers regarding to this. Did you come uo with a solution yet?

Erikkk gravatar image Erikkk  ( 2020-10-19 04:26:33 -0600 )edit

Yes, please see the solution on this post once it gets moderated!

weterpellman gravatar image weterpellman  ( 2020-10-19 14:34:05 -0600 )edit

this works for me, thanks!

Erikkk gravatar image Erikkk  ( 2020-10-20 08:58:12 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-10-19 14:33:31 -0600

weterpellman gravatar image

The error is showing that in, line 41 imports the queue module, but apparently there can be a version mismatch between python 2/3 calling the module "Queue" vs "queue".

In your catkin workspace, src/rosserial/rosserial_python/src/rosserial_python/, try changing the line "import queue" to the following:

    import queue
except ImportError:
    import Queue as queue
edit flag offensive delete link more


Thank you, it worked like a charm for me on ROS Melodic.

Marcus Barnet gravatar image Marcus Barnet  ( 2021-05-12 14:07:34 -0600 )edit

Question Tools


Asked: 2020-09-21 23:47:11 -0600

Seen: 4,719 times

Last updated: Sep 21 '20