我想使用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
有谁知道为什么?