[Solved] Error Running the basic_robot.py example

Hi Team,


I am following above url for steps and on executing i am getting below error:

pi@raspberrypi:~/GoPiGo/Software/Python/Examples/Basic_Robot_Control $ sudo python basic_robot.py
Traceback (most recent call last):
File “basic_robot.py”, line 39, in <module>
from gopigo import * #Has the basic functions for controlling the GoPiGo Robot
File “build/bdist.linux-armv7l/egg/gopigo.py”, line 49, in <module>
IOError: [Errno 2] No such file or directory

Please help

it seems the gopigo library hasn’t been installed properly. Are you using Raspbian for Robots or your own Raspbian SD card?

If it’s your own card, then this step most likely didn’t work properly:

cd /home/pi/Desktop/GoPiGo/Setup
sudo ./install.sh

Could you try that and let us know if it helps?

And if you’re running Raspbian for Robots, then there’s an issue with the card, and I would recommend doing a DI Update on it.

I hope this gives you a few pointers.

Hey @rajat-ray, any progress on this?

Hey John,

I am unable to reply to the post, as it’s not allowing to login currently.

I am glad that you have come back to me. The steps mentioned by you has
been done earlier also by me. Just to add I am using Raspberry Pi to do the
setup of gopigo.


So you followed the steps that @cleoqc recommended. We assume you’re using a Raspberry Pi, that’s a good start. Which version of the Raspberry Pi?

If the install didn’t work, I would recommend downloading and installing Raspbian for Robots. You can find more about how to download and install it on this:

Give it a shot?

I have installed Raspbian for robots on existing Raspberry Pi card.

And with the new installation you’re still getting the error:

Is that correct?

That’s right John, hoping to see some magic.

Well, I’m afraid there is not magic, only engineering.

Maybe we should double check you’re using Raspbian for robots. Can you please go to the Desktop and take a picture if you’re using VNC, or in the command line, type

cd ~/Desktop 
ls -l

And take a screenshot of the results?


Please find attached screenshot

Hey @rajat-ray this hasn’t had Raspbian for Robots installed on it. It looks like you have a basic install of Raspbian on it. Please see the links above for installing Raspbian for Robots!

here are the steps that I have done after assembling the gopigo. My gopigo
and raspberrypi are assembled together.

  1. Connected the Raspberrypi with Ethernet cable to my Windows laptop

  2. sudo apt-get update

3. sudo apt-get upgrade

4. git clone https://github.com/DexterInd/GoPiGo.git

5. A folder named GoPiGo should appear in you current working directory.

6. Open it and go to Setup Files directory:

  • cd Setup*

7. The install script is called install.sh . Make it executable

sudo chmod +x install.sh

8. Run the script and follow the instructions


9. sudo reboot

10. Open Putty with raspberrypi.local



cd /home/pi/GoPiGo/Software /Python/

sudo python setup.py install
11. cd ~/GoPiGo/Software/Python/Examples/Basic_Robot_Control

pi@raspberrypi:~/GoPiGo/Software/Python/Examples/Basic_Robot_Control $ sudo
python basic_robot.pyTraceback (most recent call last): File
"basic_robot.py", line 39, in <module> from gopigo import * #Has the
basic functions for controlling the GoPiGo Robot File
"build/bdist.linux-armv7l/egg/gopigo.py", line 49, in
<module>IOError: [Errno 2] No such file or directory

And then I get above error.



Was this just copied from this older post? The mis-spellings are exactly the same!

Again, to move forward, I think your best option is to Install Rapsbian for Robots. See how to do it here.

If you really need to continue to use a different operating system, please run these commands:

cd /home/pi/GoPiGo/Software /Python/
sudo python setup.py install

And post a screenshot of the results.

On the existing system I ran below commands and please find attached
cd /home/pi/GoPiGo/Software /Python/ sudo python setup.py install

@rajat-ray: Can you run the install script again as sudo and paste the output here

sudo ./install.sh

From the error, it looks like one of the packages didn;t install correctly. If you still face the same problem, can you post a screenshot of the error too

Here you go the entire log

gopigolog.txt (11.5 KB)

Doesn’t appear to be anything in the txt file.

Did you run the install scripts? Do you have a screenshot for Karan?

Yes. I ran and entire log is in txt file. I can very well open the log

I also tried opening the log and it is empty. Can you try uploading it again along with the screenshots .

Thanks for having the patience to test this out. I also wanted to ask if there is specific reason why you are not using our Raspbian for Robots image.