Do I have an error with rospy file tcpros_base.py?

asked 2020-12-26 13:21:04 -0500

gomesnelito gravatar image

Firstly, I'd like to pardon for any rookie mistakes as I am starting to learn how to work with ROS. While following the tutorials for a publisher in python using rospy, I attempted to run on my command line and the following error occured:

File "/home/nel/PycharmProjects/AutoMec-AD/ROS/src/automec_ros/scripts/talker.py", line 39, 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 60, in <module>
    import rospy.impl.init
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/init.py", line 54, in <module>
    from .tcpros import init_tcpros
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros.py", line 45, in <module>
    import rospy.impl.tcpros_service
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 54, in <module>
    from rospy.impl.tcpros_base import TCPROSTransport, TCPROSTransportProtocol, \
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 160
    (e_errno, msg, *_) = e.args
                   ^
SyntaxError: invalid syntax

So, what can I do to solve this? Should I reinstall ROS or was this my mistake? I'm using ROS Noetic. Thank you for your attention.

edit retag flag offensive close merge delete

Comments

1

Did you manage to fix the error? I have the same error ...

nilooskh gravatar image nilooskh  ( 2020-12-30 04:28:20 -0500 )edit

Yes I did! Change the value on that file "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py" from (e_errno, msg, *_) = e.args to (e_errno, msg) = e.args

gomesnelito gravatar image gomesnelito  ( 2020-12-30 13:14:03 -0500 )edit