If your python is a 64 bit version the binary install for the 32 bit will not work. However, there is a 64 bit version here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
If you're worried because they're unofficial don't. I have used many installations from that link for my 64 bit python and they're working great.
Answer from yuvi on Stack OverflowIf your python is a 64 bit version the binary install for the 32 bit will not work. However, there is a 64 bit version here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
If you're worried because they're unofficial don't. I have used many installations from that link for my 64 bit python and they're working great.
Currently, pygame is not available for 64 bit Python (or so it seems on Pygame Site).
The one you installed maybe 32 bit & thus causing the ImportError.
In Python 3.x, print is a function & hence the SyntaxError.
Pycharm for Python 3.x is available Pycharm Download
I would recommend using Python 3.x (32 bit) because most of the libraries seem to be compatible with it & also, 64 bit version doesn't provide much performance benefit as such. I personally use PyScripter IDE
This maybe very handy at times - Very useful precompiled binaries for several libraries
i am new to python, and i am trying to work with pygame.
i made sure to install pygame and everything, but the IDE is still giving me this error
import pygame ModuleNotFoundError: No module named 'pygame'
i looked through several websites and tried the suggested solutions, but nothing worked. can someone please help?
Videos
go to python/scripts folder, open a command window to this path, type the following:
CopyC:\python34\scripts> python -m pip install pygame
To test it, open python IDE and type
Copyimport pygame
print (pygame.ver)
It worked for me...
Here are instructions for users with the newer Python 3.5 (Google brought me here, I suspect other 3.5 users might end up here as well):
I just successfully installed Pygame 1.9.2a0-cp35 on Windows and it runs with Python 3.5.1.
- Install Python, and remember the install location
- Go here and download
pygame-1.9.2a0-cp35-none-win32.whl - Move the downloaded .whl file to your
python35/Scriptsdirectory - Open a command prompt in the
Scriptsdirectory (Shift-Right clickin the directory >Open a command window here) Enter the command:
pip3 install pygame-1.9.2a0-cp35-none-win32.whlIf you get an error in the last step, try:
python -m pip install pygame-1.9.2a0-cp35-none-win32.whl
And that should do it. Tested as working on Windows 10 64bit.
I've installed it on the terminal as far as I know and even get the notification "Successfully installed pygame-1.9.4.dev0" but every time I try to import it on my module I'm getting the error : ModuleNotFoundError: No module named 'pygame'
Don't know what to do
Which operating system and Python version? Do you have more than one Python version on your computer? How exactly did you install pygame?
I think I had a similar problem, but using windows.
When I ran my program through geany it gave an error that it couldnt find pygame. When I tried using the python IDE it was fine, but wouldn't load modules i created. Finally i managed to get past it properly by running the program through the command prompt, however I had so many errors it was faster to rewrite.
-
I am newish to coding, I have done some projects in c through GitHub online code space, such as a basic sudoku solver. I recently switched to using VS code using my windows laptop. I've successfully downloaded python onto my computer, and can run python programs. I've also downloaded pygame using "pip install pygame". Everything seems to be set up correctly but when I run my python pygame program nothing happens except this error message, "Import pygame" could not be resolved"
the version of python i have is 3.11.4
any help or people who have experienced similar problems would be much appreciated, thanks.
UPDATE: issue resolved, https://code.visualstudio.com/docs/python/python-tutorial#_install-and-use-packages <tutorial worked perfectly thanks to user lighttigersoul
When I try importing pygame into VSCode with "import pygame" the output says:
Traceback (most recent call last):
File "/Users/Germosen/Desktop/5games/Space Shooter/code/main.py", line 1, in <module>
import pygame
ImportError: No module named pygameWhen I run."pip3 install pygame" in the terminal (and VS terminal) in says the requirement is already satisfied, and when I run "python3 —version" in terminal to see if python is downloaded, it says "Python 3.13.0" meaning it is. I've tried solving this for two hours straight but nothing's working.
I'm pretty sure I only have one version of python installed (3.14).
I know I only have one version of pygame installed (pygame-ce).
I had to fallow the Indian IT computer guy tutorial on how to install pip and create a path for it. (I did so successfully), I'm not sure why I did not have pip with a path pre installed.
The IDE I'm using is PyCharm 2025.2.5, this was installed before I had pip or pygame-ce.
pygame-ce shows on my pip list in my command window.
I tried using 'import pygame' in my IDE (no success).
UPDATE: Got it working. It was an IDE settings issue.