Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python-编译错误-无法导入名称';gpio';_Python_Compilation_Gpio - Fatal编程技术网

python-编译错误-无法导入名称';gpio';

python-编译错误-无法导入名称';gpio';,python,compilation,gpio,Python,Compilation,Gpio,我在这里试用本教程: 每当我执行.py文件时,都会出现错误“无法导入名称'gpio'” 这是我在安装其他所有东西后使用的代码,如tut中所述: #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 p

我在这里试用本教程:

每当我执行.py文件时,都会出现错误“无法导入名称'gpio'”

这是我在安装其他所有东西后使用的代码,如tut中所述:

#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)
我对这一切都很陌生,所以请容忍我。
非常感谢。

得到了关于orange pi Zero的相同问题。。。我从中获得了python库,然后它开始工作:

root@orangepizero:~# wget https://pypi.python.org/packages/e6/52/a6b558fd5c8eb11e5de710271d59881769425e61d3adf6d235836ca877cc/pyA10Lime-0.2.1.tar.gz
root@orangepizero:~# tar -zxf pyA10Lime-0.2.1.tar.gz
root@orangepizero:~# cd pyA10Lime-0.2.1/
root@orangepizero:~/pyA10Lime-0.2.1#
root@orangepizero:~/pyA10Lime-0.2.1# vi setup.py
# 
# @line 60, add :
#             elif "sun8i" in processor:
#                 print ("Detected processor: " + print_color(processor) + " (Probably Allwinner H2+/H3)")
# 
root@orangepizero:~/pyA10Lime-0.2.1# python setup.py install
root@orangepizero:~/pyA10Lime-0.2.1# python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyA20.gpio import gpio
>>> from pyA20.gpio import port
>>> gpio.init()
>>> gpio.setcfg(port.PG7, gpio.OUTPUT)
>>> gpio.output(port.PG7, gpio.HIGH)
>>>
>>> gpio.output(port.PG7, gpio.LOW)
>>> exit()

usefull link

完全回溯始终是您从教程repo运行的
setup.py
的可能副本?我可以上传一个类型脚本。是的,我确实运行了setup.py。