Ex. 3.1 not executing

Good Day
I’m having trouble executing the square pattern vis rosrun command. When I run it, nothing happens, prompt is gone and nothing happens with BB8.
From other posts here that relate to this exercise, I check and have the required files. When I run the script with python it works.

Thanks for the help.

Hi @Cobra711,

Welcome to our ROS Community.

A possible reason why rosrun is not running your script is that it may not have execute permissions.

Could you try this before running rosrun?

chmod +x path/to/move_bb8_square.py



Well I did follow lesson 3 and experimented with the permissions but as you can see in the screen I did have the proper "x"s
Take a look at my errors, looks like I’m getting stuck at the beginning with problem in the dependency “geometry…”

*** to update, that folder /var/mail is empty when I checked

Hi @Cobra711 ,

I see the bash interpreter complaining about the syntax. Then what you need is to add the shebang to the first line of your script.

Please add the shebang below to the first line of your script and it should work:

#! /usr/bin/env python

Hello @ralves
Again thank you for coming to the rescue. The line you suggested is in my .py file. I just copied the whole thing in lesson 2. You can see it in the first screenshot. I checked the directory and found that /env is a exe file and python it self is sitting in the /usr/bin, so I tried that “#! /usr/bin python” but with similar effect so I just went back to the original that included /env
I see that @tesfayewakessa also had the same problem. Maybe he can share what he did.


Problem solved :triumph:

I just deleted the contend of the move_bb8_square.py and copied again from lesson 2. Works like a charm now. Guess some problem during the original copy/paste


Great to hear that now it works.

Could you paste here the first line of the script that works?


#!/usr/bin/env python

I used the IDE to do the delete and paste this time and not the “vi” editor.
Originally I used the "CTRL-C’ and “CTRL-V” into the vi, maybe some undesired character got created.

1 Like

Thanks for pasting the first line of your code, @Cobra711 ,

it indeed contains the line I asked to be used:

#! /usr/bin/env python