Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pygame Error "No available video device" on online 'repl.it'

Tags:

I'm using a website called "Repl.it" to code, and I recently found out that they have Pygame pre-installed. I tried using it, and when I tried to open a screen, I got this error:

Traceback (most recent call last):
File "python", line 3, in <module>
pygame.error: No available video device

Here's the code:

import pygame
pygame.init()
screen = pygame.display.set_mode((400,200))
screen.init()

I have very little coding experience so I have no idea how to fix this. Please help!

like image 899
Not My Name Avatar asked Jan 23 '18 00:01

Not My Name


People also ask

Does REPL IT support pygame?

Although PyGame is a standard Python library, Replit provides it installed as a separate language. Create a new repl and select PyGame from the language dropdown.

How do I fix pygame video system is not initialized?

Pygame. error video system not initialized can be fixed by stopping the main loop of implementation with the exit() function. The pygame. init() error is caused by its function not being called and can be solved with the import and initialization of pygame modules.


1 Answers

Repl.it does not support pygame windows. Sadly i can't think of any options for running pygame windows online, i think you have to run them locally.

like image 121
jotjern Avatar answered Sep 20 '22 13:09

jotjern