Robotics StackExchange | Archived questions

rclpy commend crushed in ROS2

what is the mean of SYntaxError: invalid syntax ini rclpy/init.py? Please help this question

python db_reader.py
Traceback (most recent call last):
  File db_reader.py", line 3, in <module>
    import rclpy
  File "/opt/ros/bouncy/lib/python3.6/site-packages/rclpy/__init__.py", line 23
    def init(*, args=None):
              ^
SyntaxError: invalid syntax

Asked by MSS on 2018-10-31 08:32:31 UTC

Comments

We're gonna need a lot more information to be of use here... What is db_reader.py?

Asked by allenh1 on 2018-10-31 14:47:28 UTC

Answers

You're using Python 2 (python db_reader.py) but rclpy and all of ROS 2 supports only Python 3 so you should run the following python3 db_reader.py

Asked by marguedas on 2020-01-23 05:32:58 UTC

Comments