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

asked 2019-12-08 02:39:33 -0500

ezgialisan gravatar image

hi im uing ubuntu 16.04 and ros kinetic. When i try to do moveit tutorials http://docs.ros.org/kinetic/api/movei... 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

edit retag flag offensive close merge delete

Comments

Please show your complete Python script.

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

gvdhoorn gravatar image gvdhoorn  ( 2019-12-08 02:50:39 -0500 )edit

i don't know how i show it

ezgialisan gravatar image ezgialisan  ( 2019-12-08 02:58:05 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-08 03:00:21 -0500 )edit

Add a shebang at the top of your script.

#!/usr/bin/python3

arjo129 gravatar image arjo129  ( 2019-12-08 04:25:59 -0500 )edit
1

@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.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-08 08:23:48 -0500 )edit