Under the current build, I am having issues with os.path.exists() behaving differently after the call to RGBMatrix(). I thought it might be similar to Cpython bug?! include path break after rgbmatrix() because I am using a vent due to running on RaspberryPi under Trixie (you can’t really use pip anymore, has to comp from apt install python3-xxxx.) I tried using the system.path.append() hack from that post to no avail. This is the bit of code that breaks:
import sys
sys.path.append(“venv/lib/python3.13/site-packages/”)
import os
from rgbmatrix import RGBMatrix, RGBMatrixOptions
myPath = os.path.abspath(sys.argv[0])
print("Before RGBMatrix: " + sys.argv[0] + " os.path.exists is " + str(os.path.exists(sys.argv[0])))
print("Before RGBMatrix: " + myPath + " os.path.exists is " + str(os.path.exists(myPath)))
matrix = RGBMatrix()
print("After RGBMatrix: " + sys.argv[0] + " os.path.exists is " + str(os.path.exists(sys.argv[0])))
print("After RGBMatrix: " + myPath + " os.path.exists is " + str(os.path.exists(myPath)))
path is true on the relative path both times, but False on the absolute path after the call to RGBMatrix(). For example, this prints (dots are me carving off the long path):
Before RGBMatrix: testpath.py os.path.exists is True
Before RGBMatrix: /home/……./testpath.py os.path.exists is True
Suggestion: to slightly improve display update, add
isolcpus=3
at the end of /boot/cmdline.txt and reboot (see README.md)
After RGBMatrix: testpath.py os.path.exists is True
After RGBMatrix: /home/……./testpath.py os.path.exists is False
This is under Raspbian based on Debian Trixie on a Pi running Python 3.13 using a default venv. Only thing special in the venv is the rgb_led library I built while that vent was active. It is run as such:
sudo vent/bin/python testpath.py
-or–
sudo python testpath.py
Any thoughts? I am sure the vent has something to do with it. Maybe I need to build the lib using the venv. I did not test a relative path with slashes, not sure if that is related.