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 max7219.led

See original GitHub issue

Type of Raspberry Pi

raspberry pi model b+

Linux Kernel version

linux 4.4.34+ #930 Wed Nov 23 15:12:30 GMT 2016 armv6l GNU/Linux

Expected behaviour

hi, i have this issue executing any python file : No module named max7219.led

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-armv6l/egg
running install_lib
running build_py
creating build
creating build/lib.linux-armv6l-2.7
creating build/lib.linux-armv6l-2.7/luma
creating build/lib.linux-armv6l-2.7/luma/led_matrix
copying luma/led_matrix/virtual.py -> build/lib.linux-armv6l-2.7/luma/led_matrix
copying luma/led_matrix/device.py -> build/lib.linux-armv6l-2.7/luma/led_matrix
copying luma/led_matrix/segment_mapper.py -> build/lib.linux-armv6l-2.7/luma/led_matrix
copying luma/led_matrix/helpers.py -> build/lib.linux-armv6l-2.7/luma/led_matrix
copying luma/led_matrix/legacy.py -> build/lib.linux-armv6l-2.7/luma/led_matrix
copying luma/led_matrix/const.py -> build/lib.linux-armv6l-2.7/luma/led_matrix
copying luma/led_matrix/init.py -> build/lib.linux-armv6l-2.7/luma/led_matrix
creating build/bdist.linux-armv6l
creating build/bdist.linux-armv6l/egg
creating build/bdist.linux-armv6l/egg/luma
creating build/bdist.linux-armv6l/egg/luma/led_matrix
copying build/lib.linux-armv6l-2.7/luma/led_matrix/virtual.py -> build/bdist.linux-armv6l/egg/luma/led_matrix
copying build/lib.linux-armv6l-2.7/luma/led_matrix/device.py -> build/bdist.linux-armv6l/egg/luma/led_matrix
copying build/lib.linux-armv6l-2.7/luma/led_matrix/segment_mapper.py -> build/bdist.linux-armv6l/egg/luma/led_matrix
copying build/lib.linux-armv6l-2.7/luma/led_matrix/helpers.py -> build/bdist.linux-armv6l/egg/luma/led_matrix
copying build/lib.linux-armv6l-2.7/luma/led_matrix/legacy.py -> build/bdist.linux-armv6l/egg/luma/led_matrix
copying build/lib.linux-armv6l-2.7/luma/led_matrix/const.py -> build/bdist.linux-armv6l/egg/luma/led_matrix
copying build/lib.linux-armv6l-2.7/luma/led_matrix/init.py -> build/bdist.linux-armv6l/egg/luma/led_matrix
byte-compiling build/bdist.linux-armv6l/egg/luma/led_matrix/virtual.py to virtual.pyc
byte-compiling build/bdist.linux-armv6l/egg/luma/led_matrix/device.py to device.pyc
byte-compiling build/bdist.linux-armv6l/egg/luma/led_matrix/segment_mapper.py to segment_mapper.pyc
byte-compiling build/bdist.linux-armv6l/egg/luma/led_matrix/helpers.py to helpers.pyc
byte-compiling build/bdist.linux-armv6l/egg/luma/led_matrix/legacy.py to legacy.pyc
byte-compiling build/bdist.linux-armv6l/egg/luma/led_matrix/const.py to const.pyc
byte-compiling build/bdist.linux-armv6l/egg/luma/led_matrix/init.py to init.pyc
creating build/bdist.linux-armv6l/egg/EGG-INFO
copying luma.led_matrix.egg-info/PKG-INFO -> build/bdist.linux-armv6l/egg/EGG-INFO
copying luma.led_matrix.egg-info/SOURCES.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying luma.led_matrix.egg-info/dependency_links.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying luma.led_matrix.egg-info/namespace_packages.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying luma.led_matrix.egg-info/not-zip-safe -> build/bdist.linux-armv6l/egg/EGG-INFO
copying luma.led_matrix.egg-info/requires.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying luma.led_matrix.egg-info/top_level.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
creating dist
creating 'dist/luma.led_matrix-0.9.0-py2.7.egg' and adding 'build/bdist.linux-armv6l/egg' to it
removing 'build/bdist.linux-armv6l/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-armv6l.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-armv6l.egg
Searching for luma.core==0.7.0
Best match: luma.core 0.7.0
Adding luma.core 0.7.0 to easy-install.pth file

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

Using /usr/local/lib/python2.7/dist-packages
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 RPi.GPIO==0.6.3
Best match: RPi.GPIO 0.6.3
Adding RPi.GPIO 0.6.3 to easy-install.pth file

Using /usr/lib/python2.7/dist-packages
Searching for monotonic==1.3
Best match: monotonic 1.3
Adding monotonic 1.3 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 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

and after install i try to execute the example:

user@raspberrypi-WEATHER:~/scripts/panel-led/raspberrypi-matrix-led-max7219$ sudo python
python/matrix-cpu.py 
Traceback (most recent call last): File "python/matrix-cpu.py", line 4, in <module> import max7219.led as led ImportError: No module named max7219.led

this is the code into the python file:

#!/usr/bin/env python

import os
import max7219.led as led

def getCPUtemperature():
res = os.popen("vcgencmd measure_temp").readline()
return(res.replace("temp=","").replace("'C\n",""))

device = led.matrix(2)
device.orientation(270)

try:
while True:
device.show_message("CPU temperature: " + getCPUtemperature() + "C");
except KeyboardInterrupt:
pass
finally:
device.clear()

any help…?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
dorekscommented, Apr 9, 2017

fixed the issue, seems that it was incorrectly connected, i have swapped the pins of leds and now works!!!

thank you so much @rm-hull for your support!!! by the way, any python file with rss and clock…?

1reaction
dorekscommented, Apr 9, 2017

sure, the first picture is just with led.matrix connected to the raspberry pi.

image 2017-04-09 19 58 13

and that other picture is the running sudo python matrix_demo.py, from directory luma.led_matrix/examples:

image 2017-04-09 20 00 57

it’s moving but doesn’t show nothing clear to read

Read more comments on GitHub >

github_iconTop Results From Across the Web

error with luma.led_matrix
I am trying to setup the environment for my led modules Max7219 but every time I try I ... ImportError: No module named...
Read more >
8 x 8 LED array driven by max7219 on the Raspberry Pi via ...
Going a little nuts here: I get a “No module named max7219.led” error despite (apparently) successful install of the max7219 and python-dev ...
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 >
dotmatrix error - Forum - Raspberry Pi - element14 Community
but when I run it I have an error " ImportError: No module named 'max7219' " .... although I enabled spi and every...
Read more >
Raspberry PI max7219 8×8 LED Matrix – scrolling digital clock
is a so-called dictionary and works intuitively. ... code to display a scrolling digit clock on an 8 by 8 LED matrix using...
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