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

ImportError: No module named queue

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

weterpellman gravatar image

In the Hello World tutorial: http://wiki.ros.org/rosserial_arduino... When trying to initialize rosserial with rosrun rosserial_python serial_node.py /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

Comments

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 -0500 )edit

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

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

this works for me, thanks!

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

1 Answer

Sort by ยป oldest newest most voted
6

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

weterpellman gravatar image

The error is showing that in SerialClient.py, 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/SerialClient.py, try changing the line "import queue" to the following:

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

Comments

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

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

Question Tools

Stats

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

Seen: 4,919 times

Last updated: Sep 21 '20