On a stock Jessie install, gpiozero works. E.g.
>>> from gpiozero.devices import pin_factory
>>> print(pin_factory)
<class 'gpiozero.pins.rpigpio.RPiGPIOPin'>
I then upgrade to gpiozero 1.4 with
sudo apt update
sudo apt full-upgrade
Which I'd like because the pinout command is super useful, and gpiozero is among the upgrade:
The following packages will be upgraded:
bind9-host debconf debconf-i18n debconf-utils gtk2-engines-pixbuf
libbind9-90 libc-ares2 libdns-export100 libdns100 libdvdnav4 libgcrypt20
libgnutls-deb0-28 libgnutls-openssl27 libgtk2.0-0 libgtk2.0-bin
libgtk2.0-common libirs-export91 libisc-export95 libisc95 libisccc90
libisccfg-export90 libisccfg90 liblwres90 libsmbclient libtiff5 libwbclient0
perl perl-base perl-modules python-gpiozero python3-gpiozero python3-thonny
rpi-chromium-mods samba-common samba-libs xarchiver
But although pinout works (it's so cool!) nothing else does, e.g.
>>> from gpiozero.devices import pin_factory
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name pin_factory
And none of my python code with
from gpiozero import ...
Which used to work does either. For example, for
from gpiozero import DistanceSensor
ultrasonic = DistanceSensor( echo=17, trigger=4 )
ultrasonic.distance
which worked before doesn't. What happens now is that it sits for a while and then outputs 1.0 regardless of what's in front of the HC-SRO4. Any ideas? Any ideas? Thanks in advance!