I just installed the full & latest (November 2017) raspbian to try out gpiozero. My simple python3 script that I try to run is this:
python3 test.py
from gpiozero import LED, Button
from signal import pause
led = LED(17)
button = Button(3)
button.when_pressed = led.on
button.when_released = led.off
pause()
but it gives me
Traceback (most recent call last):
File "test.py", line 1, in <module>
from gpiozero import LED, Button
File "/home/pi/gpiozero.py", line 1, in <module>
from gpiozero import LED
ImportError: cannot import name 'LED'
So it is just not able to see the lib. By now I've checked apt-get and also tried pip for 2.7 and pip3 for python 3 but it's just not found? Must be super simple...
I know it is almost a year old question, but I found the answer. Uninstall the pip and pip3 libraries
and install the library through apt
that worked for me