How do I download Pygame for Python 3.5.1?

How do I download Pygame for Python 3.5.1?

Im gonna guess your using Windows. If you are not then there is no special version of pygame for Python 3+. If you do have Windows then read below.

You will need pygame to be part of your path to do this. This is so you can use this in the command prompt. Make sure you use it as an admin when doing this.

First you need to find out what bit version of Python you have. Open your Python shell and at the top of the window it should say something like Pygame V(some number) (bit number) You want the bit number.

Now you ned to open the command prompt. Use the windows key + r key to open the run menu, and type cmd and press enter. Or you can just search your PC for cmd and right click on it and select run as admin to open as an admin.

Python comes with a special path command called pip. I am not gonna get into this module too much, but in short it is used to install addition Python modules. The first thing you need to do is this command…

pip install wheel

The screen should print some stuff off while doing this. You can tell if the module installed correctly because it should print something like wheel installed successfully. We are gonna need this later.

Now you need to get your pygame file. Go here and find the pygame section. If you have python 32 bit download you should download this pygame-1.9.2b1-cp35-cp35m-win32.whl or if you have 64 bit Python download pygame-1.9.2b1-cp35-cp35m-win_amd64.whl. I am pretty sure these are the ones you need for your bit version, but I installed pygame on my Windows 10 a few months ago so they may be different now.

Once you have this downloaded go back to the command prompt. Enter this command…

pip install (filename)

Make sure it includes the .whl extension. If you get an error then specify the path to the folder the file is in (which should be the downloads folder). Once again you should see a message similar to pygame installed successfully.

Once all this is done open your Python shell and type…

import pygame

If it works you now have pygame available for use. If not then there are a few more things you can try…

  1. Try restarting your PC. Sometimes these things dont take affect until a system restart.
  2. Try installing a different version of pygame from the website listed above. It may just be a simple issue due to bit version differences.
  3. Make sure you actually installed the pygame module from the file. It may of thrown an error that appeared to be an actual successful installation. It always pays to double-check.

Like I said before I installed pygame on my Windows 10 with Python 3.4 64 bit a few months ago in the same way I told you here so it should work, but may be outdated. Anyways I hope this helps you with your pygame installation issues and the best of luck to you!

For windows now you simply use pip as its available directly to install as pygame.

Use the following command:

python -m pip install pygame

It should output something like this, then you can test if its working by importing pygame.

PS C:Windowssystem32> python -m pip install pygame
Collecting pygame
  Downloading pygame-1.9.2b1-cp35-cp35m-win32.whl (4.4MB)
  100% |################################| 4.4MB 264kB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.2b1
PS C:Windowssystem32> python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
Type help, copyright, credits or license for more information.
>>> import pygame
# Note there is no error here...
>>> quit()
PS C:Windowssystem32>

How do I download Pygame for Python 3.5.1?

This worked preety well for me:

System: Ubuntu 16.10 x64

[email protected]:~/python# cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.10
DISTRIB_CODENAME=yakkety
DISTRIB_DESCRIPTION=Ubuntu 16.10
NAME=Ubuntu
VERSION=16.10 (Yakkety Yak)
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=Ubuntu 16.10
VERSION_ID=16.10
HOME_URL=http://www.ubuntu.com/
SUPPORT_URL=http://help.ubuntu.com/
BUG_REPORT_URL=http://bugs.launchpad.net/ubuntu/
PRIVACY_POLICY_URL=http://www.ubuntu.com/legal/terms-and-policies/privacy-policy
VERSION_CODENAME=yakkety
UBUNTU_CODENAME=yakkety
[email protected]:~/python# 

Python 2.7 + Pygame:

[email protected]:~/python# python -V
Python 2.7.12+
# apt-get install python-pip
# pip install --upgrade pip
# pip install pygame

Python 3.5 + Pygame:
(Python 3.5.2+ in my case)

[email protected]:~/python# python3 -V
Python 3.5.2+

# sudo apt-get install python3-pip
# pip3 install --upgrade pip
# pip3 install pygame

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *