You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! First of all, pygame 1.9.4 is a rather dated version of pygame, perhaps you should upgrade to pygame 2.1.2 (fair warning, pygame2 has issues on pi hardware ATM, so this will likely be slower than pygame 1.9.4)
I'm not really sure, but I believe the videodriver should be set to fbcon in your case. If you used sudo while setting the environment variable, it is invisible to processes run without sudo. So remember to set the environment variable without sudo
Hello @ankith26, thank you for your answer, I tried setting up the SDL_VIDEODRIVER environment variable (directly in the python code with os.environ[...] = ... ) but it doesn't help. Also I don't need to do this to make it work as root, so I think it is a permission issue. Nevertheless I couldn't find which file would it be.
Version 1.9.4 is working fine (is the default when using apt install python3-pygame) and I have the same issue nevertheless with the version 2.1.2 (installed with pip install pygame ).
Which version of Raspberry Pi OS are you on? With the latest version of PyGame and Pi OS, I would not recommend fbcon (but that would be correct for PyGame 1.9.4) but KMS/DRM. https://wiki.libsdl.org/FAQUsingSDL
Environment:
You can get some of this info from the text that pops up in the console when you run a pygame program.
Current behavior:
When user runs
display.init()
an error happens :pygame.error: Unable to open a console terminal
If run as root, everything is working.
Expected behavior:
If user as proper persmission
display.init
should workSteps to reproduce:
On a raspberrypi without XServer, connect an HDMI screen, install pygame.
Error message:
pygame.error: Unable to open a console terminal
Stack trace/error output/other error logs
No stacktrace
QUESTION
What permissions is needed to have
display.init()
working as non-root user ?More details : https://stackoverflow.com/q/70757953/17965313
Notes
SDL_VIDEODRIVER
tofbcon
ordummy
is not solving the issuedisplay.init()
without problemDISPLAY
is not set and doesn't exist.dispay.init()
however I don't need a display.The text was updated successfully, but these errors were encountered: