GPIOZero:ImportError:没有名为RPi.GPIO的模块

时间:2018-01-08 10:50:54

标签: raspberry-pi raspbian gpio gpiozero

我想使用GPIO Zero

安装了RPi.GPIO:

sudo apt-get install python-rpi.gpio
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-rpi.gpio is already the newest version (0.6.3~stretch-1).
0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded.

我可以在SSH控制台中使用它:

pi@blankpi:~ $ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
>>> 

但是如果我将它与GPIOZero一起使用,我收到了这个错误:

PIGPIO_ADDR=192.168.1.122 python
>>> import RPi.GPIO as GPIO
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named RPi.GPIO

有谁知道为什么?

0 个答案:

没有答案