0

I have a python code, using gpiozero. When running this code on a RPI-ZEROW it fails, while running same code on RPI3 it succeeds. All installed pretty much the same ( shown checks below ), pigpio is at it last version and located in same directories:

relevant part of code ( error comes from line-2):

from gpiozero import Button, OutputDevice
from gpiozero.pins.pigpio import PiGPIOFactory  <-- This line
from sys import platform, path
import time

on RPI ZEROW:

guy@HomePi_Alarm:/ $ sudo apt-get install pigpio
Reading package lists... Done
Building dependency tree       
Reading state information... Done
pigpio is already the newest version (1.64-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
guy@HomePi_Alarm:/ $ cd /
guy@HomePi_Alarm:/ $ sudo find -name "pigpio"
./dev/pigpio
./usr/share/doc/pigpio
./opt/pigpio
guy@HomePi_Alarm:/ $ python3 ~/github/Alarm/alarm_watcher.py 
Traceback (most recent call last):
  File "/home/guy/github/Alarm/alarm_watcher.py", line 2, in <module>
    from gpiozero.pins.pigpio import PiGPIOFactory
  File "/usr/lib/python3/dist-packages/gpiozero/pins/pigpio.py", line 11, in <module>
    import pigpio
ImportError: No module named 'pigpio'
guy@HomePi_Alarm:/ $ 

On RPI3:

guy@lab_pi:/ $ sudo apt-get install pigpio
Reading package lists... Done
Building dependency tree       
Reading state information... Done
pigpio is already the newest version (1.64-1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
guy@lab_pi:/ $ sudo find -name "pigpio"
./opt/pigpio
find: ‘./run/user/1001/gvfs’: Permission denied
./dev/pigpio
find: ‘./proc/1247/task/1247/net’: Invalid argument
find: ‘./proc/1247/net’: Invalid argument
./usr/share/doc/pigpio
guy@lab_pi:/ $ python3 ~/github/Alarm/alarm_watcher.py 

log start @lab_pi, IP:192.168.2.113, OS:linux, Name:HomePi-AlarmSys monitor

0

You also need to install the pigpio Python modules.

sudo apt-get install python-pigpio python3-pigpio

They will already be installed on "full" versions of Raspbian.

I may have got the module names wrong. If so use

apt-cache search pigpio

  • sudo apt-get install python3-pigpio did the trick. TNX! – Guy . D Jul 21 '18 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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