Factsheet
How to install pygame in Windows 10 for python 3.9? - Stack Overflow
how do i download pygame?
python 3.x - How to install pygame windows 10? - Stack Overflow
Need help installing pygame
Videos
Β» pip install pygame
You could use the pre-release version that supports Python 3.9.0.
python3 -m pip install pygame --pre --user
Many packages do not have pre-built wheels for Python 3.9 as it is new.
Also pygame-1.9.6-cp27-cp27m-win_amd64.whl is for Python 2.7
Your best bet is to revert to Python 3.8.6 to install pre-built wheel with pip
when i try to download pygame nothing happens. i am new at this.
For me this command works.->py -m pip install -U pygame --user But first, make sure you properly configure your environment variables. This tutorial http://www.aaronstannard.com/how-to-setup-a-proper-python-environment-on-windows/ will help you how to setup environment variables for python, make sure you do it correctly only step 2 ,no need to do any other steps from this tutorial, now you can follow my steps that were listed below. I will assume that you have already installed python in your computer
Step1
Search for cmd and Right click on cmd and do run as administrator.
Step2
Run the command, py -m pip install -U pygame --user, but before you run this command first of all make sure you configure your environment variables properly.
Step3
Type python in command prompt, this will take you to the python command line which will look like this ">>>".If not then you have a problem with your system variables.
Step4
Make sure you are in python command line and then type import pygame,and after this press ctrl+z and enter that will take you out from python command line.
Step5
Make sure you are not in python command line and then run this command py -m pygame.examples.aliens,if the game starts then congrats you are done.
It can be possible that the pip/ wheel is not installed follow this link to install pip link
If already installed maked sure it is updated if not
You can use this code to update: python βm ensurepip β-upgrade or pip install --upgrade pip
To install wheel pip install wheel or upgrade pip install wheel --upgrade
once this is done you are good to install pygame
At the command line, make sure youβre in the same directory as the .whl file and run
pip install package-name.whl
Basically I have an assignment that involves me using pygame, but I don't know how to install it, I've read in multiple places that I just say pip install pygame and that somehow magically fixes everything, but it gives me error, and yes I do import the pip module, but it doesn't work. I've tried it in vs code, python, idle, it doesn't work, I would rlly appreciate some help. For simplicity's sake, let's pretend I just installed idle, how exactly can I use pygame? Thanks in advance
For people wanting to install Pygame on Windows 10, do try the command below:
Using windows powershell type:
pip3 install pygame - - only binary :all:
**Important note: The - - has no space inbetween them. I cant put both dashes tgt on reddit as it will look like this β
Hope it helps and stay tune for more 9knows tech hacks.
EDIT: Solution provided by skuhduhduh
I've instaleld libraries in the past no problem but this particular library is proving very troublesome. I have Windows 10 64 bit PC.
I've installed it successfully using the command prompt:
C:\Program Files\Python37>python -m pip install pygame Collecting pygame Using cached https://files.pythonhosted.org/packages/ed/56/b63ab3724acff69f4080e54c4bc5f55d1fbdeeb19b92b70acf45e88a5908/pygame-1.9.6-cp37-cp37m-win_amd64.whl Installing collected packages: pygame Successfully installed pygame-1.9.6 C:\Program Files\Python37>
If I open IDLE (Python 3.7) I can successfully use the following commands import pygame and print(pygame.ver) to obain the output:
Hello from the pygame community. https://www.pygame.org/contribute.html 1.9.6
However, if I try to use Spyder, I just get the error message:
import pygame ModuleNotFoundError: No module named 'pygame'
I have also tried Pycharm and get a similar message. I guess there is something going wrong with the location of these files, but I don't know what? I've installed other libraries and used them just fine so I don't know what could be the issue. Its been asked on other websites and I've tried solutions like using conda to install it (it just froze in the command prompt) and also tried installing it inside the scripts folder.