I've been getting into GPIO recently with the GPIOZero library but when i first tried it today it completely failed. As my first foray into GPIO i set up a circuit to light up an LED with the push of a button, so simple nothing could go wrong, right? I imported the library like so: from gpiozero import Button, LED then i set up my components: led = LED(17) then the button: btn = Button(4) And then this happened:

enter image description here

I have attempted to re download the library but sudo apt-get install python3-gpiozero said that it was the latest version.

This is the circuit:


simulate this circuit – Schematic created using CircuitLab

First: what doe this error mean?

Second: How can i fix it?

  • It may be a bug. Try using sudo python to see if you still get the same error message.
    – joan
    Jun 3, 2016 at 14:39
  • @joan if i run sudo python3 and then enter in the python commands i get the error but if i save i file with the code it does nothing
    – sir_ian
    Jun 3, 2016 at 15:07
  • The script works for me (with or without sudo). I'd guess you have an inconsistent version of the RPi.GPIO module.
    – joan
    Jun 3, 2016 at 15:57
  • @joan finally got around to experimenting with this some more and it does work with pins 27 and 17 and probably more more but just not with pin number @#%$^&$ 4
    – sir_ian
    Jun 22, 2016 at 18:23

1 Answer 1


I have seen this before, when the 1-wire interface has been enabled. If you've enabled 1-wire in Raspberry Pi configuration, you won't be able to use GPIO4 for general use. Try disabling it:


  • Sadly this pi is no longer in service so I can't test it.
    – sir_ian
    Nov 25, 2016 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.