MLB-LED-Scoreboard/mlb-led-scoreboard

new install on Bookworm, No module named 'statsapi', then No module named 'rgbmatrix'

Closed this issue · 2 comments

Fresh install on Pi 3 with Bookworm OS
Got the error "No module named 'statsapi'". Saw the closed issues on this and tried running

whoops had more to put in here.
I tried running sudo python3 -m pip install -r requirements.txt --break-system-packages even though I saw no mention of externally managed packages error.
That did not help as now I get the following:
Traceback (most recent call last):
File "/home/pi/mlb-led-scoreboard/driver/init.py", line 32, in set_mode
import rgbmatrix
ModuleNotFoundError: No module named 'rgbmatrix'
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/numpy/init.py", line 130, in
from numpy.config import show as show_config
File "/usr/local/lib/python3.11/dist-packages/numpy/config.py", line 4, in
from numpy.core._multiarray_umath import (
File "/usr/local/lib/python3.11/dist-packages/numpy/core/init.py", line 50, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

Original error was: libopenblas.so.0: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/pi/mlb-led-scoreboard/main.py", line 28, in
import driver
File "/home/pi/mlb-led-scoreboard/driver/init.py", line 50, in
sys.modules['driver'] = DriverWrapper()
^^^^^^^^^^^^^^^
File "/home/pi/mlb-led-scoreboard/driver/init.py", line 14, in init
self.set_mode(DriverMode.HARDWARE)
File "/home/pi/mlb-led-scoreboard/driver/init.py", line 36, in set_mode
import RGBMatrixEmulator
File "/usr/local/lib/python3.11/dist-packages/RGBMatrixEmulator/init.py", line 2, in
from RGBMatrixEmulator.emulators.matrix import RGBMatrix
File "/usr/local/lib/python3.11/dist-packages/RGBMatrixEmulator/emulators/matrix.py", line 1, in
from RGBMatrixEmulator.emulators.canvas import Canvas
File "/usr/local/lib/python3.11/dist-packages/RGBMatrixEmulator/emulators/canvas.py", line 1, in
import numpy as np
File "/usr/local/lib/python3.11/dist-packages/numpy/init.py", line 135, in
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.

Well I resolved the issue by simply running the rgbmatrix installation steps in the install.sh manually.

Note that I had this same error on 2 different completely fresh installs on RaspiOS Bookworm, so not sure why the rgbmatrix install did not work correctly on either one. I was running the install.sh as root. I also tried just re-runing the install.sh after the 1st failure, but that had no affect.