Raspberry Pi 2 & WebIOPi – Error AttributeError: ‘module’ object has no attribute ‘GPIO’

If you are getting this error on a RPI2 - The following solution worked for me.
AttributeError: 'module' object has no attribute 'GPIO'

In the webiopi-0.7.X directory is the /python directory:
1.CD into /python/native/
Edit the file:  cpuinfo.c
change "BCM2708" to "BCM2709"

2.While still in python/native/   
Edit the file gpio.c 
change #define BCM2708_PERI_BASE 0x20000000   to 
#define BCM2708_PERI_BASE 0x3f000000

3.Head back out to your root webiopi-0.7.X directory and run setup.sh again.
sudo ./setup.sh

Hope this helps.

Leave a Reply