rm-hull/luma.led_matrix

Python3 installation, module not found

Closed this issue · 4 comments

After installing from source with sudo python3 setup.py install the luma.led_matrix module cannot be found by python3, while the correct .egg is clearly in the PYTHONPATH

sys.path = ['/home/pi/Python/luma.led_matrix', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-arm-linux-gnueabihf', '/usr/lib/python3.4/lib-dynload', '/usr/local/lib/python3.4/dist-packages', '/usr/local/lib/python3.4/dist-packages/luma.led_matrix-0.3.0-py3.4.egg', '/usr/lib/python3/dist-packages']
Traceback (most recent call last):
File "./8_digit.py", line 18, in
from luma.led_matrix.device import max7219, sevensegment
ImportError: No module named 'luma.led_matrix'

Also tried it on an Ubuntu 16.10 laptop. Still same error:

$ python3 test.py
Traceback (most recent call last):
File "test.py", line 5, in
from luma.led_matrix.device import max7219, sevensegment
ImportError: No module named 'luma.led_matrix

However, when using python2 everything works as expected.

Yeah, there's a bit of work to do to get it working properly on Python 3:

  • I'd used bytearray, without really exploring how painful it was to make it work across 2 and 3, so I think I will look at something different (this relates to the other issue you opened)
  • Namespaced packaged are what I think is probably the root cause of this issue

If you can bear with us while it is a bit choppy, it'll soon settle down - in fact, your input has been really useful, so please don't hold back on raising issues.

I think I found it. After installation the luma.core package was located in a regular directory, while luma.led_matrix was part of an .egg-file.
So I added zip_safe=False, to setup.py to install led_matrix in a folder and now it works.

This should be fixed in the next release.