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.

max7219.led module not found

See original GitHub issue

After running:

sudo python max7219/examples/matrix_test/py

I get the error:

Traceback (most recent call last):
    File "max7219/examples/matrix_test.oy", line 3, in <module>
    import max7219.led as led
ImportError: No module named max7219.led

There were no errors when cloning from the repo. I have installed wiringPi, and I have also changed the SPI settings, just like in the README.txt

Any help would be greatly appreciated.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dorekscommented, Apr 14, 2017

hi, i have the exactly same issue:

user@raspberrypi-WEATHER:~/scripts/panel-led/max7219$ sudo 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-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…?

0reactions
rm-hullcommented, Apr 14, 2017

@JohannesRegner - The library has been completely rewritten and it has a different namespace now. The classes are quite different but there is a nod to some legacy methods.

Have a look at the documentation and examples.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Max7219 LED matrix not working properly - Arduino Forum
I used sample code from a store's website. The matrix is suppose count from 0-9 and A-Z. The wiring is correct. But, some...
Read more >
error with luma.led_matrix - Raspberry Pi Forums
I am trying to setup the environment for my led modules Max7219 but every time ... The headers or library files could not...
Read more >
8 x 8 LED array driven by max7219 on the Raspberry Pi ...
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 >
Interfacing MAX7219 LED Dot Matrix Display with Arduino
Learn to use MAX7219 Module with Arduino along with working, pinout, wiring, Arduino code ... As a result, no more than eight LEDs...
Read more >
HiLetgo 2pcs MAX7219 8 * 8 Dot Matrix Module DIY Kit ...
... Matrix Module DIY Kit MAX7219 8x8 Common Cathode LED Dot Matrix DIY MCU Control Display Module ... VCC and GND is not...
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