Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pygame not showing anything in the window [duplicate]

Tags:

python

pygame

Just started programming in python and pygames. Whenever I try running a py file with pygames, the pygames window will appear, but there will be absolutely nothing in it. No errors in the log, but nothing shows, it's just a gray screen. I tried running it on IDLE, and through the command line (I'm on a mac so I use the terminal)

And it's not just my programs that aren't showing anything, I've tried to run one of pygames examples, and it will still not display anything. For example, if I run the pygames alien example, the window will appear with a blank gray background. I'll hear the audio for the program, but no display.

Anything would help, I'm at a loss especially since no errors are showing in the log.

EDIT1: I'm using Python 3 (and I really need to keep using Python 3)

EDIT2: I'm using python 3.7. pygames version 1.9.4. The examples are with the pygames, they were downloaded together, so I assume it's for that version.

EDIT3: ok, my OS is Mojave 10.14. I've tried starting the application by: opening the file, running it on IDLE, and running it through the command line, none have worked. python2 is installed, but when I run the pygame it's a python3 file

like image 809
Cjan Avatar asked Nov 07 '18 02:11

Cjan


People also ask

What does Flip () do in pygame?

flip() for software displays. It allows only a portion of the screen to updated, instead of the entire area. If no argument is passed it updates the entire Surface area like pygame.

How do I open multiple pygame Windows?

The short answer is no, you cannot open two Pygame windows in the same process.


2 Answers

Known issue with Mojave - see their issue tracking: https://github.com/pygame/pygame/issues/555

like image 83
toejough Avatar answered Nov 16 '22 01:11

toejough


You can also install new pygame using pip install pygame=2.0.0.dev6. This worked in my case.

like image 26
regor Avatar answered Nov 16 '22 00:11

regor