question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: No module named led_matrix.device

See original GitHub issue

Type of Raspberry Pi

I use Raspberry Pi Model 2

Linux Kernel version

Linux Jonny 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux

Hi, i’ve installed the library on my raspberry pi, and i get the following error on the examples:

Traceback (most recent call last):
  File "examples/matrix_demo.py", line 10, in <module>
    from luma.led_matrix.device import max7219
ImportError: No module named led_matrix.device

More informations:

lsmod | grep -i spi
spi_bcm2708             5038  0
pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)

python setup.py install

running install
running bdist_egg
running egg_info
creating luma.led_matrix.egg-info
writing requirements to luma.led_matrix.egg-info/requires.txt
writing luma.led_matrix.egg-info/PKG-INFO
writing namespace_packages to luma.led_matrix.egg-info/namespace_packages.txt
writing top-level names to luma.led_matrix.egg-info/top_level.txt
writing dependency_links to luma.led_matrix.egg-info/dependency_links.txt
writing manifest file 'luma.led_matrix.egg-info/SOURCES.txt'
reading manifest file 'luma.led_matrix.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'doc/_build'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
warning: no previously-included files matching '*~' found under directory '*'
warning: no previously-included files matching '.coverage' found under directory '*'
writing manifest file 'luma.led_matrix.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/luma
creating build/lib.linux-armv7l-2.7/luma/led_matrix
copying luma/led_matrix/__init__.py -> build/lib.linux-armv7l-2.7/luma/led_matrix
copying luma/led_matrix/virtual.py -> build/lib.linux-armv7l-2.7/luma/led_matrix
copying luma/led_matrix/legacy.py -> build/lib.linux-armv7l-2.7/luma/led_matrix
copying luma/led_matrix/device.py -> build/lib.linux-armv7l-2.7/luma/led_matrix
copying luma/led_matrix/segment_mapper.py -> build/lib.linux-armv7l-2.7/luma/led_matrix
copying luma/led_matrix/const.py -> build/lib.linux-armv7l-2.7/luma/led_matrix
copying luma/led_matrix/helpers.py -> build/lib.linux-armv7l-2.7/luma/led_matrix
creating build/bdist.linux-armv7l
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/luma
creating build/bdist.linux-armv7l/egg/luma/led_matrix
copying build/lib.linux-armv7l-2.7/luma/led_matrix/__init__.py -> build/bdist.linux-armv7l/egg/luma/led_matrix
copying build/lib.linux-armv7l-2.7/luma/led_matrix/virtual.py -> build/bdist.linux-armv7l/egg/luma/led_matrix
copying build/lib.linux-armv7l-2.7/luma/led_matrix/legacy.py -> build/bdist.linux-armv7l/egg/luma/led_matrix
copying build/lib.linux-armv7l-2.7/luma/led_matrix/device.py -> build/bdist.linux-armv7l/egg/luma/led_matrix
copying build/lib.linux-armv7l-2.7/luma/led_matrix/segment_mapper.py -> build/bdist.linux-armv7l/egg/luma/led_matrix
copying build/lib.linux-armv7l-2.7/luma/led_matrix/const.py -> build/bdist.linux-armv7l/egg/luma/led_matrix
copying build/lib.linux-armv7l-2.7/luma/led_matrix/helpers.py -> build/bdist.linux-armv7l/egg/luma/led_matrix
byte-compiling build/bdist.linux-armv7l/egg/luma/led_matrix/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-armv7l/egg/luma/led_matrix/virtual.py to virtual.pyc
byte-compiling build/bdist.linux-armv7l/egg/luma/led_matrix/legacy.py to legacy.pyc
byte-compiling build/bdist.linux-armv7l/egg/luma/led_matrix/device.py to device.pyc
byte-compiling build/bdist.linux-armv7l/egg/luma/led_matrix/segment_mapper.py to segment_mapper.pyc
byte-compiling build/bdist.linux-armv7l/egg/luma/led_matrix/const.py to const.pyc
byte-compiling build/bdist.linux-armv7l/egg/luma/led_matrix/helpers.py to helpers.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying luma.led_matrix.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying luma.led_matrix.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying luma.led_matrix.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying luma.led_matrix.egg-info/namespace_packages.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying luma.led_matrix.egg-info/not-zip-safe -> build/bdist.linux-armv7l/egg/EGG-INFO
copying luma.led_matrix.egg-info/requires.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying luma.led_matrix.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
creating dist
creating 'dist/luma.led_matrix-0.9.0-py2.7.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing luma.led_matrix-0.9.0-py2.7.egg
removing '/usr/local/lib/python2.7/dist-packages/luma.led_matrix-0.9.0-py2.7.egg' (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/luma.led_matrix-0.9.0-py2.7.egg
Extracting luma.led_matrix-0.9.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
luma.led-matrix 0.9.0 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/luma.led_matrix-0.9.0-py2.7.egg
Processing dependencies for luma.led-matrix==0.9.0
Searching for ws2812==1.0.0
Best match: ws2812 1.0.0
Processing ws2812-1.0.0-py2.7-linux-armv7l.egg
ws2812 1.0.0 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/ws2812-1.0.0-py2.7-linux-armv7l.egg
Searching for luma.core==0.7.5
Best match: luma.core 0.7.5
Adding luma.core 0.7.5 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for smbus2==0.1.4
Best match: smbus2 0.1.4
Processing smbus2-0.1.4-py2.7.egg
smbus2 0.1.4 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/smbus2-0.1.4-py2.7.egg
Searching for RPi.GPIO==0.6.3
Best match: RPi.GPIO 0.6.3
Processing RPi.GPIO-0.6.3-py2.7-linux-armv7l.egg
RPi.GPIO 0.6.3 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/RPi.GPIO-0.6.3-py2.7-linux-armv7l.egg
Searching for monotonic==1.3
Best match: monotonic 1.3
Processing monotonic-1.3-py2.7.egg
monotonic 1.3 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/monotonic-1.3-py2.7.egg
Searching for Pillow==4.1.0
Best match: Pillow 4.1.0
Adding Pillow 4.1.0 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for spidev==3.3
Best match: spidev 3.3
Adding spidev 3.3 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for olefile==0.44
Best match: olefile 0.44
Adding olefile 0.44 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Finished processing dependencies for luma.led-matrix==0.9.0
`

In the dir /usr/local/lib/python2.7/dist-packages/ Are the following entries:

luma
luma.core-0.7.5-nspkg.pth
luma.core-0.7.5.dist-info
luma.led_matrix-0.9.0-py2.7.egg

I will get the following error:

 python examples/matrix_demo.py
Traceback (most recent call last):
  File "examples/matrix_demo.py", line 10, in <module>
    from luma.led_matrix.device import max7219
ImportError: No module named led_matrix.device

What i am doing wrong??

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
rm-hullcommented, Apr 14, 2017

Sorry, I misread your description and attributed the same cause as #20 - looks like your problem is actually different.

Did you install with pip or python setup.py install ?

I would be inclined to try:

$ sudo rm -rf /usr/local/lib/python2.7/dist-packages/luma*
$ sudo -H pip install -U luma.led_matrix

And then try the example again

1reaction
rm-hullcommented, Oct 24, 2017

Have a look at the documentation, especially this section: http://luma-led-matrix.readthedocs.io/en/latest/install.html#installing-from-pypi

It shows you how to install pip and all the other pre-requisites.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No module named luma.led.matrix.device · Issue #151 - GitHub
from luma.led_matrix.device import max7219 ImportError: No module named luma.led_matrix.device. My pip version is 9.0.1 and python version ...
Read more >
error with luma.led_matrix - Raspberry Pi Forums
from luma.led_matrix.device import max7219 ImportError: No module named 'luma.led_matrix' Still stumped and hoping for more ...
Read more >
Python error "ImportError: No module named" - Stack Overflow
The problem in my case was that there was the permission to newly installed modules were not 755 . That was because umask...
Read more >
Could some one help me with an error message from a dot ...
Traceback (most recent call last): File "nextbus-matrix.py", line 5, in <module> import Image ImportError: No module named Image.
Read more >
MAX7219 on micro:bit - MicroPython Forum (Archive)
I later ordered the led matrix but I want to know how to get it to work with ... line 1, in <module>...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found