dom5353
Posts: 1
Joined: Wed Jan 08, 2014 10:03 pm

GPIO Attribute Error Help!!!

Wed Jan 08, 2014 10:09 pm

Hi

I have been following a tutorial which allows for an LED to be turned on and off from a button on a webpage. However I have been unable to run the programme. The tutorial is from the following url: http://mattrichardson.com/Raspberry-Pi-Flask/ and is the third topic.

When ever I run my python script from the LXT terminal I get the following message.
"hello-gpio.py" line 6, in <module>
GPIO.setmode(GPIO.BCM)
AttributeError: 'module' object has no attribute 'setmode'

I have had this issue when I have run programmes with GPIO module in the past. I got round this by running these programmes using idle 3 instead of idle.

If anyone could help me with this it would be much appreciated. Also if someone could also point me in the right direction to a good article/post which provides a script which allows you to turn a pin on/off from a webpage that would be great.

Thanks
Dom

User avatar
croston
Posts: 708
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: GPIO Attribute Error Help!!!

Wed Jan 08, 2014 10:28 pm

Sounds like you have:
1) a really old version of RPi.GPIO
or
2) a file/directory called RPi or GPIO in the same area as your script.

Return to “Troubleshooting”