Issues Installing Pygame

2019-08-04 13:52发布

问题:

I`m having some issues installing Pygame. I am running a 64 bit Windows 8 system, with a 32 bit version of Python 3.4.

Here is how I have been trying to install it so far:

  1. I have visited http://pygame.org/download.shtml and downloaded the file called pygame-1.9.2a0.win32-py3.2.msi.
  2. I have executed the file and selected 'Install for all users'.
  3. At this point it asks me to select a Python location into which I should install Pygame. I then select 'Will be installed on local hard drive' from the dropdown. A text box asks me to input an alternate Python location. This is set to C:\PythonX. I set it to my Python location - C:\Python34.
  4. I finish the installer and go to the shell. I input import pygame into the command line. It gives the following error:

Traceback (most recent call last): File "", line 1, in import pygame File "C:\Python34\lib\site-packages\pygame__init__.py", line 95, in from pygame.base import * ImportError: DLL load failed: The specified module could not be found.

If I look in the Python34 file after the install, I find the Pygame folder in the location C:\Python34\Lib\site-packages\pygame.

Any help would be greatly appreciated.

回答1:

Installing from MSI and not pip make sure you get the correct version that matches your set up of Python.

you are running a 64 bit Windows 8 system, with a 32 bit version of Python 3.4.

you downloaded the 32 bit version of Pygame for Python 3.2 you need the one for the Python 3.4 version.

This one from official bitbucket should work as it is the correct version for python 3.4 32 bit compatibility.

https://bitbucket.org/pygame/pygame/downloads/pygame-1.9.2a0-hg_5974ff8dae3c+.win32-py3.4.msi