Pygame blank screen with python3 and osx

In this article, we explain how to fix blank window when you execute a pygae project on OSX.

Follow the next simple steps to fix the issue:

  1. Uninstall pygame
pip unistall pygame # try this command until it says pygame is not installed.
  1. Install some dependencies

For using pygame you will need to install some dependencies with brew:

brew install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf. This requires homebrew.
  1. Clone the pygame source code:
git clone https://github.com/pygame/pygame.git for the latest (possibly not stable version).

You can switch to a tag for using a stable version of pygame.

Inside your virtualenv execute:

python setup.py install

Install cloudl take some minutes, try again your pygame project!