# How to install Pygame Zero on macOS

> Learn how to install Pygame Zero on macOS, and how to fix the SDL.h file not found error during pip install by installing pgzero straight from GitHub.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2021-02-16 | Topics: [Python](https://flaviocopes.com/tags/python/) | Canonical: https://flaviocopes.com/python-pygame-installation/

A few months ago I bought a book from Raspberry Pi Press called [Code the Classics](https://wireframe.raspberrypi.org/books/code-the-classics1). It's an awesome book that talks about some classic games, including Sensible Soccer and Centipede, and then proceeds to creating a clone of those games with [Python](https://flaviocopes.com/python-introduction/). It's a total of 5 games.

That's a very nice book, you can download it for free at the link I provided above and you can find the code of the games built in the book on [GitHub](https://flaviocopes.com/github/) at https://github.com/Wireframe-Magazine/Code-the-Classics.

The book does not actually explain how to build those games, unfortunately. It just lists the source code.

Anyway, it's a great way to start your Python game development adventure.

I finally found some time to dive into, and the first step was to install Pygame Zero, a library to create games on top of Pygame.

It's not hard, _in theory_, to install it. It is distributed through `pip`, using

```
pip install pgzero
```

But I had troubles with my Mac. It failed during the installation withat

```
fatal error: 'SDL.h' file not found
#include "SDL.h"
         ^~~~~~~
1 error generated.
```

I checked what could be the problem, and I found a possible version requirement mismatch, maybe it's a recent problem due to new releases of the libraries, but I had to install the latest version directly from GitHub, using:

```
pip install git+https://github.com/lordmauve/pgzero@master
```

Then it worked fine!
