If you see the following issue, you will need to install Pygame:
"C:\Users\USERNAME\CodaKid\Projects\Python\PROJECT_FOLDER\src\main.py", line 1, in
import pygame
ModuleNotFoundError: No module named 'pygame'
The first step to making sure pygame works is that you have a supported version of Python. Our courses are tested up to Python 3.9(not the latest version which is 3.11 at the time of this article).
If you have 3.11 installed, uninstall it, and then reinstall Python via the Launcher.
Now you can start installing Pygame.
We recommend using the Launcher to install Pygame. If that doesn't work, then follow these steps.
Windows Instructions
1. Start by opening a command line. You can do this by pressing the windows key and then typing cmd and then pressing enter.
2. Put in the following code into the command line:
py -m pip install -U pygame --user
If you get an error that Python wasn't found, please open up the Launcher and try installing Python through the Launcher again.
3. If it succeeds, make sure to restart any IDLE windows you have open before running your game.
Mac Instructions
1. Start by opening a terminal. Terminal can be found under applications/utilities.
2. Put in the following code into the command line:
python3 -m pip install -U pygame --user
If you get an error that Python wasn't found, please visit our other please open up the Launcher and try installing Python through the Launcher again.
3. If it succeeds, make sure to restart any IDLE windows you have open before running your game.
If You Still Need Help
Reach out to support using the Chat Box in the lower right hand corner.
Comments
0 comments
Please sign in to leave a comment.