-1

Adafruit LED 背包我是不是很笨(可能是)我在追求这个模块的 python 3 版本,每次下载它我都会得到 python 2.7 版本

获取我的模块

git clone https://github.com/adafruit/Adafruit_Python_LED_Backpack.git

我在树莓派上做这个

python 2 版本工作正常,但我的程序是用 python 3 编写的

我得到的新错误是:

回溯(最后一次调用):文件“/home/pi/Adafruit_Python_LED_Backpack/matrix8x16_test.py”,第 37 行,在 display.begin() 文件“/home/pi/Adafruit_Python_LED_Backpack/Adafruit_LED_Backpack/HT16K33.py”,第 53 行,在开始 self._device.writeList(HT16K33_SYSTEM_SETUP | HT16K33_OSCILLATOR, []) 文件“/usr/local/lib/python3.4/dist-packages/Adafruit_GPIO/I2C.py”,第 127 行,在 writeList self._bus.write_i2c_block_data( self._address, register, data) 文件“/usr/local/lib/python3.4/dist-packages/Adafruit_PureIO/smbus.py”,第 274 行,在 write_i2c_block_data self._device.write(data) OSError: [Errno 5 ] 输入/输出错误

4

1 回答 1

0

这个包似乎在 python 2 和 3 之间兼容。

克隆包后,当你想在 python 解释器中安装它时,执行这个命令:

sudo python -3 setup.py install

'-3' 表示在 python 3 上运行。

于 2017-03-22T22:09:32.613 回答