Python Forum
[PyGame] Installation problems
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Installation problems
#1
Hi, I have a bit of a dilemma. I need both pygame and python on my computer. I have read the forums available and I have tried many suggestions available form there and the internet but they do not work. I have uninstalled python and pygame and reinstalled as per instructions. I realise at the beginning my problem was I had python 64 bit and pygame 32 bit so. I uninstalled and installed both 32 bit. Still does not work. When installing I just went with the suggested options of the program installer but did not work. I am thinking that perhaps pygame is not installing in the correct folder for me to import it when starting idle. Very interested in your suggestions as I am at my wits end. I have uninstalled python and pygame again awaiting someones suggestion. My operating system is Windows 10 64 bit.  Thank you in advance for any help you are able to offer.  Confused Oh and add to my confusion I can find pygame 64 bit whl files but not .msi files. I was under the impression I should be downloading a .msi file.
Reply
#2
You can install either 32 bit python or 64 bit with your OS, but i can assure you 32 bit has a history of less problems when it comes to pygame. Whatever your python bit type is, your pygame must be also.

Are you installing python2.x or python3.x? I would shy away from python3.6 for the moment, until pygame catches up. But you can install python3.5.X or python2.7.X and should have no problems. 

Wheels are the new fad in python. MSI installers havent been made with pygame since python3.4. You can either install python3.4 and pygame for python3.4 and use that MSI installer, or you can use pip and wheels to install python3.5 and pygame for python 3.5. 

EDIT
Quote:And checking the link now, they do actually have pygame for python3.6 in the unofficial wheels
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

basic pygame install guide
http://python-gaming.com/pygame/docs/install.html

pip is a python 3rd party installer, and has lately come included with python. After you install python, it is located in ./Scripts directory of where ever you install python to. I would suggest to customize the installation path to C:\PythonXX-XX where XX is your version and bit type when you install python. Otherwise the new default location sucks at C:\Users\USERNAME\AppData\Local\Programs\Python\PythonXX-XX

bring up a windows command prompt and navigate to your scripts directory and execute 
pip.exe install YOURWHEEL
 
Where YOURWHEEL is the full path to your downloaded wheel. OR just move the wheel to the scripts directory and input the name of the wheel.

for downloading hte proper wheel. cp35 in the wheel name means python3.5, and win32 means 32 bit while amd64 means 64 bit.

When your all done you can verify your python installation by going into a python interpreter from your windows command prompt C:\PythonXX-XX\python.exe if that is where you installed it to. 

and execute 
import pygame
if you get >>> without an error your good to go.

Only at this point you should be trying to get it to work with an IDE such as IDLE/Eclipse/PyCharm/etc.
Recommended Tutorials:
Reply
#3
Thank you, this is what I have done:

From www.python.org/downloads/release/python-352/   I downloaded:  Windows x86 executable installer making sure I changed the path to go directly to the C: which looks like: C:\Python35-32,  drive as suggested.

I tested this by opening idle and all seemed good. 

I then added the file: pygame-1.9.2-cp35-cp35m-win32 (2).whl directly to the C: drive as well.

I then went into idle and typed:  import pygame

The following error came up:

>>> import pygame

Traceback (most recent call last):

  File "<pyshell#0>", line 1, in <module>

    import pygame

ImportError: No module named 'pygame'
>>> 

I am missing something! Should the pygame file go into the Python35-32 folder?

Sorry to be a pain. I really do need to get this so I will keep persisting, hopefully with your very much appreciated help.

Also when  went to install YOURWHEEL in the command prompt this came up: "could not find a version that satisfies the requiment YOURWHEEL (from version: ) No matching distribution found for YOURWHEEL.
You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command."

I will try and do this now.

I have installed the new version of pip however it is sitting:  C:\Users\Owner\AppData\Local\pip

Should I move this folder direct to the C: drive?

When I went through the command prompt to install pip again I get this:

"Could not find a version that satisfied the requirement YOURWHEEL. (from versions: )
No matching distribution found for YOURWHEEL"


Is this because it is not located directly on the C: drive like Python35-32 is?
Reply
#4
Here a minute installing pygame to 3.5.
Wheel for Gohlke,i place wheel file in scripts folder.
From cmder.
C:\Python35\Scripts
λ pip install pygame-1.9.2-cp35-cp35m-win32.whl
Processing c:\python35\scripts\pygame-1.9.2-cp35-cp35m-win32.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.2

C:\Python35\Scripts
λ cd ..

C:\Python35
λ 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
>>> pygame.__version__
'1.9.2'
>>>
Reply
#5
Thank you so much. This worked! I really appreciate the time and effort Metulburr and Snippsnap made to answer my post. Thank you guys so much. Being new to this forum if there is any where I should go to mark this a solved or give you guys a thumbs up let me know.
Thanks again.

No off to see if I can do something with Pygame. :-)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pygame installation problems Gheryk 5 8,497 Nov-29-2023, 08:49 PM
Last Post: E_Mohamed

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020