Smbus module not found

Hi there,

For my existing RaspberryPi I choose option 3 “Modify your own image”. The script gave some errors (see attached terminal export). I moved on building the GoPiGo and tried to run basic_test_all.py:

pi@tiberius ~/GoPiGo/Software/Python $ sudo python basic_test_all.py
Traceback (most recent call last):
File “basic_test_all.py”, line 22, in <module>
from gopigo import *
File “/home/pi/GoPiGo/Software/Python/gopigo.py”, line 34, in <module>
import smbus
ImportError: No module named smbus

So my setup is clearly missing something. I think this is because of the directory layout on a non standard DexterIndustries SD card (see errors in the attached install script dump).

How to fix this? I’m not fluent with apt-get/github commands so please spell it out for me…

Thanks!

Hey,
Looks like some of the packages were not installed properly. Can you run: sudo apt-get update before you start the script and run the script as root: sudo ./install.sh and check if the script completes properly.

-Karan

Hello Karan,

That did indeed fix the import error, I could import smbus. But then I got “smbus IOError: [Errno 2] No such file or directory”. After some searching I found the cure for that here:

https://www.raspberrypi.org/forums/viewtopic.php?t=100189&p=697310

I had to enable I2C in the raspi-config, reboot and then it worked.

Thanks!