How do I properly install the latest version of pygame?

Viewed 470

I'm having trouble using the pygame module in my code. I installed pygame using the command py -3 -m pip install pygame --user and it said it was successful. However, when running my code, I get this error No module named 'pygame' in the Python idle 3.9.0.

3 Answers

You can try to download it using pip, by running the following command:

pip install pygame

or with pip3:

pip3 install pygame

just a simple command python -m pip install pygame or python3 -m pip install pygame

pip install pygame -U

This should upgrade your pygame to the newest version.

Related