Posts: 82
Joined: Thu Jul 03, 2014 9:30 pm

How to load PYGAME2 from console (no X desktop)?

Sat Jan 28, 2023 3:39 pm

I have:
When I run the command...

Code: Select all

tiny-bandit --noX=True
...from the console (again, I am testing using a real console session, not an SSH session), I get the following error:
Fatal Python error: PyEval_SaveThread: the function must be called with the GIL held, but the GIL is released (the current Python thread state is NULL)
Python runtime state: initialized

Current thread 0xb6fa9640 (most recent call first):
File "/home/pi/tiny-bandit/", line 22 in initialize
File "/home/pi/tiny-bandit/", line 66 in startup
File "/home/pi/tiny-bandit/", line 112 in <module>
How do I get past this, so I can run the program from the console? From another Raspberry Pi 4, I can run it from a Pi OS desktop (without the --noX=True attribute), so the issue appears to be related to running it from the console.

This is my work-in-progress code:

Return to “Python”