Sorry, thought i edited to say i am on windows 64 bit
When trying to install Pygame using pip, I get the following error:
"requirement 'pygame.whl' looks like a file name, but the file does not exist pygame.whl is not a valid wheel filename."
I have my file paths right and pip is working. I have attempted to install 32 bit and 64 bit pygame but neither is working. In the command prompt I enter "pip install pygame.whl" (I renamed the file which I don't think should matter and it is saved under downloads).
How can I resolve this error?
It seems there is no PyPi package for pygame. On Ubuntu / Debian you should be able to simply do:
sudo apt-get install python-pygame
Should be similar for other package managers on other distros.
On windows, use the download the provided installer:
Thankyou so much for your help ventsyv, i finally figured it out. i believe it was an issue with the installer from pygames site. i found another site with a link to pygame and specifically for python 3.4.2. i now have no error messages and its working great. Thanks for putting up with me haha.
Related
So I have this little problem. When I try to install Pygame for Python 3.4 I download a .whl (wheel?) file and don't know how to use it. Some guys told me something about pip but don't know how to use/install it.
You can install the wheel file for Python 3.4 here:
First you have to install the wheel package from pip then install Pygame.
pip install wheel
pip install pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl
Here's a video to help you install pip on Youtube.
Here is a great VIDEO tutorial: http://goo.gl/PurJqk (it is on youtube)
This is what I use to install .whl modules to python (I do this in the 64 bit windows cmd):
cd "C:\Users\(YOUR USERNAME)\Desktop"
(assuming that you have the .whl file on your desktop)
C:\Python34\Scripts\pip install filename.whl
(where filename.whl is the full name of the .whl file, with the .whl extension)
After that it will install, and you are free to use PyGame!
14 y/o? Good for you! You can put the file into your python/scripts folder and run pip install *file* (where *file* is your filename).
Here is a link to download pygame for different versions of Python, up to Python 3.4 in 32 bit and 64 bit.
To test if it installed properly, open your python shell and type in this code:
import pygame
Please note that these are not official binaries and you are basically trusting a third-party to compile and provide the binary for you.
Step 1
If you have not got python version 3.4.2, then you must uninstall your current version of python (or don't if you don't even have python).
Step 2
Then download and install python 3.4.2 from http://filehippo.com/download_python/58901/ .
Step 3
Follow the instructions and wait until it is ready for use.
Step 4
Now download the 'pygame-1.9.2a0-cp34-none-win32.whl' file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame and copy it into C:\Python34\Scripts .
Step 5
In C:\Python34\Scripts hold the shift key and right click. Click on 'Open new command window here'.
Step 6
In the command window you have opened, type in:
pip3 install pygame-1.9.2a0-cp34-none-win32.whl
It will say something like:
Unpacking C:\Python34\Scripts\pygame-1.9.2a0-cp34-none-win32.whl
Installing collected packages: pygame
Successfully installed pygame
Cleaning up...
And it will then just say C:\Python34\Scripts>, which means that pygame has now been installed!
Step 7
Go to the Python 3.4.2 Shell, and type in:
import pygame
if there is an error, pygame didn't install properly, otherwise, congratulations!
You can then:
import pygame.examples.aliens as game
and then on the next line type in:
game.main()
to see a professional pygame example.
For more information, visit my website at:
https://ronaldobutrus.github.io/Site3/index.html
Good Luck! :)
https://bitbucket.org/pygame/pygame/downloads
"pygame-1.9.2a0-hg_5974ff8dae3c+.win32-py3.4.msi"
This is the package you want, RedNax said this but did not point out the exact package.
The other answer doesn't work for me on Windows 10 Pro N x64.
What did work was installing the win32.whl instead of amd64. I put this in my Python3.4\Scripts folder where pip is and ran
pip install pygame-1.9.2a0-cp34-none-win32.whl
This should work for others using a similar configuration.
In my experience, you need to make sure of two things:
1) Both Python and Pygame should be 32 bit - not either or both being 64 bit.
2) Both Python and Pygame should be compatible for the same version.
You may be able to get the 64 bit version to work, but not all packages have migrated to 64 bit and the small performance improvement isn't worth the frustration of trying to get it to work.
I also found the latest 32 bit Pygame (as of Feb. 5th, 2016) seems to work well with 32 bit Python 3.4.4.
I installed 32 bit python-3.4.4.msi on Windows 10 from my downloads folder to the folder C:\Python34.
Within the Python34 folder, I created a folder called "Project Directory".
In it, I placed "pygame-1.9.2a0-hg_ea3b3bb8714a.win32-py3.4.msi" which I think I got from https://bitbucket.org/pygame/pygame/downloads. Double-clicked on it. Worked the first time.
I had also installed "Microsoft Visual Studio Community 2015 with Update 1."
No idea if this helped solve the problem, but this MVSC package installs a lot of DLLs. It takes quite a while to get MVSC installed.
But - I now have Pygame working on Windows 10.
For linux if you root user then copy paste this into terminal
apt-get install python3-dev mercurial
apt-get install libsdl-image1.2-dev libsdl2-dev libsdl-ttf2.0-dev
apt-get install libsdl-mixer1.2-dev libportmidi-dev
apt-get install python-numpy
pip3 install --user hg+http://bitbucket.org/pygame/pygame
If you not root user then use sudo before start every-line.
Error is posted here as pastebin, it's very long
'''https://pastebin.com/8ssgGNdL'''
(edit paste bin expired)
https://pastebin.com/BRuPeifp
I've since tried installing packages using pip3 and still get similar results. I haven't changed anything since the last time I installed 'requests'
I'm sorry if i'm asking an annoying question. I've googled similar questions but nothing seems to help. If anyone can point me in the right place to look and solve this for my self I will be very grateful.
The error states:
fatal error: 'SDL.h' file not found
and
For help with compilation see:', 'https://www.pygame.org/wiki/MacCompile'
It looks like one or more of the SDL dependencies is missing.
Have you installed SDL dependencies mentioned on that page using HomeBrew?
It seems like it's crashing while installing PyGame. According the PyGame's Getting Started page there seems to be some issues with newer version of OS X.
Quoting from the page:
If your examples aren't running and you are using a recent version of
Mac OS X; try this line to install pygame instead:
python3 -m pip install -U pygame==2.0.0.dev6 --user
Also looking over the Internet, the problem might be because of Python3.8 itself, and therefore requiring a newer version to resolve the issue.
~ Solved ~
pygame doesn't work with python3.8 so I had to use:
pipenv install pygame==2.0.0.dev6
when testing by trying to install other packages such as requests, I was met with the same error. This error was infact the error for pygame repeating itself (I don't understand why)
Currently unable to install Pygame via pip:
pip install pygame
Getting this message:
Concerned by it being termed an EOF error, is this an error in the module itself?
There's dev versions available as of now. Get them via
pip install pygame==2.0.0.dev6
Pygame is not compatible with Python 3.8 at the moment. I would recommend you to downgrade back to 3.7 and installing with pip there.
pip is doesn't have pygame up.
But there is a alternative that worked for me. https://www.pygame.org/wiki/CompileWindows
Read and follow the steps correctly and it should install.
you also need to update your code to pygame 2.0.0 code because it's only for 3.8
BTW you have to follow the SDL2 instructions since pygame 2.0.0 uses that.
the above commands worked for me today 3-15-20 with Python-3-8-0 on Linux Mint 19
to get IDLE to recognize pygame.
sudo pip3 install pygame==2.0.0.dev6
I also had to update pip first with
sudo pip3 install --upgrade pip
Pygame requires visual studio C++ build tools to install. Ensure you have these downloaded from here.
Open power shell window and make sure your internet is on
Then type the following command
pip install pygame
It will automatically download it for you and also install it
Again make sure your internet is on
I have python 3.8.2 and it worked on my pc
I've been trying to install pygame for Python 3.5.1 on Windows 10, 64 bit. Everything I've attempted so far has resulted in an error message in some form.
My latest attempt has been when I downloaded pygame-1.9.2a0-cp35-none-win_amd64.whl (also tried the 32-bit, got same error) from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame and dragged the .whl file into Python35-32/Scripts. I then proceeded to go to command prompt and do the pip install thing, to which I got this message:
"Could not find a version that satisfies the requirement pygame-1.9.2a0-cp35-none-win_amd64 (from versions: )
No matching distribution found for pygame pygame-1.9.2a0-cp35-none-win_amd64"
I am aware that I may be installing it incorrectly, but from my understanding of other guides, this is what they say to have done. I would greatly appreciate help if possible.
It sounds like you've left the file extension off of the filename when you're calling pip install. Make sure you include the .whl extension, of pip will think the file name is the name of a package it should be downloading for you.
Pygame is not compatible with python 3.5. But it is with python 3.4. You can find binaries at: https://bitbucket.org/pygame/pygame/downloads
For previous version of python: https://www.python.org/downloads/
The first thing to check is that you have the 64 bit version of Python (the default windows download is 32bit). If not, here's the link:
https://www.python.org/downloads/release/python-360/
When you have the 64 bit python going, From the command prompt / Powershell, use "pip install pygame" or "python -m pip install pygame" then you will be sure the os, python, and pygame are all 64bit, mixing and matching doesn't work.
So I have this little problem. When I try to install Pygame for Python 3.4 I download a .whl (wheel?) file and don't know how to use it. Some guys told me something about pip but don't know how to use/install it.
You can install the wheel file for Python 3.4 here:
First you have to install the wheel package from pip then install Pygame.
pip install wheel
pip install pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl
Here's a video to help you install pip on Youtube.
Here is a great VIDEO tutorial: http://goo.gl/PurJqk (it is on youtube)
This is what I use to install .whl modules to python (I do this in the 64 bit windows cmd):
cd "C:\Users\(YOUR USERNAME)\Desktop"
(assuming that you have the .whl file on your desktop)
C:\Python34\Scripts\pip install filename.whl
(where filename.whl is the full name of the .whl file, with the .whl extension)
After that it will install, and you are free to use PyGame!
14 y/o? Good for you! You can put the file into your python/scripts folder and run pip install *file* (where *file* is your filename).
Here is a link to download pygame for different versions of Python, up to Python 3.4 in 32 bit and 64 bit.
To test if it installed properly, open your python shell and type in this code:
import pygame
Please note that these are not official binaries and you are basically trusting a third-party to compile and provide the binary for you.
Step 1
If you have not got python version 3.4.2, then you must uninstall your current version of python (or don't if you don't even have python).
Step 2
Then download and install python 3.4.2 from http://filehippo.com/download_python/58901/ .
Step 3
Follow the instructions and wait until it is ready for use.
Step 4
Now download the 'pygame-1.9.2a0-cp34-none-win32.whl' file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame and copy it into C:\Python34\Scripts .
Step 5
In C:\Python34\Scripts hold the shift key and right click. Click on 'Open new command window here'.
Step 6
In the command window you have opened, type in:
pip3 install pygame-1.9.2a0-cp34-none-win32.whl
It will say something like:
Unpacking C:\Python34\Scripts\pygame-1.9.2a0-cp34-none-win32.whl
Installing collected packages: pygame
Successfully installed pygame
Cleaning up...
And it will then just say C:\Python34\Scripts>, which means that pygame has now been installed!
Step 7
Go to the Python 3.4.2 Shell, and type in:
import pygame
if there is an error, pygame didn't install properly, otherwise, congratulations!
You can then:
import pygame.examples.aliens as game
and then on the next line type in:
game.main()
to see a professional pygame example.
For more information, visit my website at:
https://ronaldobutrus.github.io/Site3/index.html
Good Luck! :)
https://bitbucket.org/pygame/pygame/downloads
"pygame-1.9.2a0-hg_5974ff8dae3c+.win32-py3.4.msi"
This is the package you want, RedNax said this but did not point out the exact package.
The other answer doesn't work for me on Windows 10 Pro N x64.
What did work was installing the win32.whl instead of amd64. I put this in my Python3.4\Scripts folder where pip is and ran
pip install pygame-1.9.2a0-cp34-none-win32.whl
This should work for others using a similar configuration.
In my experience, you need to make sure of two things:
1) Both Python and Pygame should be 32 bit - not either or both being 64 bit.
2) Both Python and Pygame should be compatible for the same version.
You may be able to get the 64 bit version to work, but not all packages have migrated to 64 bit and the small performance improvement isn't worth the frustration of trying to get it to work.
I also found the latest 32 bit Pygame (as of Feb. 5th, 2016) seems to work well with 32 bit Python 3.4.4.
I installed 32 bit python-3.4.4.msi on Windows 10 from my downloads folder to the folder C:\Python34.
Within the Python34 folder, I created a folder called "Project Directory".
In it, I placed "pygame-1.9.2a0-hg_ea3b3bb8714a.win32-py3.4.msi" which I think I got from https://bitbucket.org/pygame/pygame/downloads. Double-clicked on it. Worked the first time.
I had also installed "Microsoft Visual Studio Community 2015 with Update 1."
No idea if this helped solve the problem, but this MVSC package installs a lot of DLLs. It takes quite a while to get MVSC installed.
But - I now have Pygame working on Windows 10.
For linux if you root user then copy paste this into terminal
apt-get install python3-dev mercurial
apt-get install libsdl-image1.2-dev libsdl2-dev libsdl-ttf2.0-dev
apt-get install libsdl-mixer1.2-dev libportmidi-dev
apt-get install python-numpy
pip3 install --user hg+http://bitbucket.org/pygame/pygame
If you not root user then use sudo before start every-line.