Robotics StackExchange | Archived questions

bash: syntax error near unexpected token `sys.argv'

hi im uing ubuntu 16.04 and ros kinetic. When i try to do moveit tutorials http://docs.ros.org/kinetic/api/moveit_tutorials/html/doc/move_group_python_interface/move_group_python_interface_tutorial.html this step

moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node('move_group_python_interface_tutorial',
                anonymous=True)

i get error like this

bash: syntax error near unexpected token `sys.argv'

can anyone help me? i only copy-paste

Asked by ezgialisan on 2019-12-08 03:39:33 UTC

Comments

Please show your complete Python script.

It's likely you don't have a proper shebang.

Asked by gvdhoorn on 2019-12-08 03:50:39 UTC

i don't know how i show it

Asked by ezgialisan on 2019-12-08 03:58:05 UTC

Click the edit button/link below your original question.

Add a few blank lines (press enter a few times).

Now copy-paste your entire Python script into the question.

Press save.

Asked by gvdhoorn on 2019-12-08 04:00:21 UTC

Add a shebang at the top of your script.

#!/usr/bin/python3

Asked by arjo129 on 2019-12-08 05:25:59 UTC

@arjo129: that will most likely cause the author to not be able to execute his script successfully as there is no support for Python 3 in ROS Kinetic by default.

Asked by gvdhoorn on 2019-12-08 09:23:48 UTC

Answers