hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.67k stars 1.17k forks source link

Python binding: AttributeError: 'rgbmatrix.core.RGBMatrixOptions' object has no attribute 'panel_type' #1156

Closed robgyiv closed 3 years ago

robgyiv commented 4 years ago

First of all, thanks so much for creating such a great library! It's been a lot of fun to be able to start writing some code and have it show on a panel so easily.

Currently on master, after following the readme and building for Python I get the following error:

$ sudo ./samples/pulsing-colors.py
Traceback (most recent call last):
  File "./samples/pulsing-colors.py", line 41, in <module>
    if (not pulsing_colors.process()):
  File "/home/pi/code/github.com/rpi-rgb-led-matrix/bindings/python/samples/samplebase.py
", line 56, in process
    options.panel_type = self.args.led_panel_type
AttributeError: 'rgbmatrix.core.RGBMatrixOptions' object has no attribute 'panel_type'

I have set HARDWARE_DESC=adafruit-hat in lib/Makefile.

If I checkout to commit 4c9a4036f44f and rebuild this does not happen. There may be a more recent commit that also works but I haven't tried it.

I'd be happy to contribute to the issue (more so in Python than C++) but may need some direction first.

Thanks again and let me know if any more information would be useful.

Hardware:

drewlustro commented 3 years ago

I am also experiencing this! master appears to be broken

cpforbes commented 3 years ago

It looks like commit 56b87b98f8aea9a95ee93449cf00831bcb3f0efa broke the python bindings.

I found the problem.

The script recommended by adafruit installed an old version into /usr/local/lib/python(2|3)/dist-packages which was being picked up before the local (not installed) version.

robgyiv commented 3 years ago

Thanks @cpforbes - this was the case for me as well as I used the adafruit guide initially. So the fix was: