← All stepsBobgame: make a Python game

Step 4 of 12

Install pygame-ce

pygame-ce is a library, which is code somebody else wrote and shared so we don't have to start from nothing. It gives us a window, drawing shapes, the keyboard and the mouse. Even though we install pygame-ce, in our code we still write import pygame.

In VS Code create a new file in the bobgame folder called requirements.txt with this single line in it

pygame-ce

A requirements.txt is just a shopping list of libraries the project needs. Install everything on the list

.venv\Scripts\pip install -r requirements.txt

On Ubuntu use .venv/bin/pip install -r requirements.txt.

You'll see a lot of text scroll by. When it stops without a red error you're done.

Docs: pygame-ce documentation