我在这里尝试了本教程: http://www.instructables.com/id/Orange-Pi-One-Python-GPIO-basic/?ALLSTEPS蟒蛇 - 编译错误 - 无法导入名称“GPIO”
每当我执行我的.py文件,我得到错误“无法导入名称‘GPIO’”
这这里是我别的都安装后使用的代码,在啧啧称:
#import the library
from pyA20.gpio import gpio
from pyA20.gpio import port
from time import sleep
#initialize the gpio module
gpio.init()
#setup the port (same as raspberry pi's gpio.setup() function)
gpio.setcfg(port.PA7, gpio.OUTPUT)
#now we do something (light up the LED)
gpio.output(port.PA7, gpio.HIGH)
#turn off the LED after 2 seconds
sleep(2)
gpio.output(port.PA7, gpio.LOW)
我很新的这一切,所以请多多包涵。 非常感谢。
完整回溯是*始终*漂亮 –
的可能的复制[ImportError:无法导入名称X](http://stackoverflow.com/questions/9252543/importerror-cannot-import-name-x) – user2728397
您是否从教程库中运行'setup.py'? –