Ask Your Question
1

ModuleNotFoundError: No module named 'SerialClient'

asked 2020-05-29 18:37:23 -0500

redskull gravatar image

Hello, I am using ROS noetic on Ubuntu 20.04. The error I am facing now was not anywhere in Ubuntu 18.04 (ROS Melodic). I don't know what's wrong here. I am trying to interface an arduino and following this tutorial link text. When I execute this line (probably the last step in tutorial), following error emerges,

rosrun rosserial_python serial_node.py /dev/ttyACM0
Traceback (most recent call last):
  File "/home/redskull/catkin_ws/devel/lib/rosserial_python/serial_node.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/redskull/catkin_ws/src/rosserial/rosserial_python/nodes/serial_node.py", line 39, in <module>
    from rosserial_python import SerialClient, RosSerialServer
  File "/home/redskull/catkin_ws/devel/lib/python3/dist-packages/rosserial_python/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'SerialClient'

Here's my environment setup

printenv | grep ROS
ROS_VERSION=1
ROS_PYTHON_VERSION=3
ROS_PACKAGE_PATH=/home/redskull/catkin_ws/src:/opt/ros/noetic/share
ROSLISP_PACKAGE_DIRECTORIES=/home/redskull/catkin_ws/devel/share/common-lisp
ROS_ETC_DIR=/opt/ros/noetic/etc/ros
ROS_MASTER_URI=http://localhost:11311
ROS_ROOT=/opt/ros/noetic/share/ros
ROS_DISTRO=noetic
edit retag flag offensive close merge delete

Comments

I have exactly the same problem, with a fresh ROS noetic on Unbutu 20.04!! Please when you get solution, share with me.

see: https://robocademy.com/2020/05/23/get... at: 2.1 Suporte ao Python Uma das versões populares do Python era 2.7. Em 1º de janeiro de 2020, o Python 2.x interrompeu seu suporte oficial. Até o ROS melódico, o suporte ao Python 2.7 estava lá, mas no Noetic, estamos recebendo suporte exclusivo do Python 3.

and: http://repositories.ros.org/status_pa... for rosserial packages.

JPeres gravatar image JPeres  ( 2020-06-19 08:00:04 -0500 )edit

Let's not ask people to directly contact you, and keep the discussion on ROS Answers. I've removed your email address.

Your post was also not an answer, but a comment, so I've converted it. Please only post answers when you're actually answering a question.

Finally: I'm unsure as to why you link to the 'robocademy' site.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-20 08:04:14 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-06-28 05:44:41 -0500

Jsamwel gravatar image

It appears the serial node module hasn't been properly updated to Python 3 which Ros Noetic uses, The init file for the rosserial_python package needs to be changed so that it can find SerialClient.py.

The location of the init file that i needed to change.

<your workspace="">/src/rosserial/rosserial_python/src/rosserial_python/__init__.py

The issue will be solved by adding a dot in front of SerialClient

from SerialClient import *

from .SerialClient import *

It might be that SerialClient.py will have issues importing some libraries as for they where still configured for python 2. I needed to change the import for Stringio and Queue as well

They are working on updating rosserial so that it will support python 3: https://github.com/ros-drivers/rosser...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-05-29 18:37:23 -0500

Seen: 110 times

Last updated: Jun 28