简体   繁体   中英

how to install pygame on windows 64BIT using windows binary installer (.msi) (ImportError: No module named 'pygame')

I have installed python 32BIT on my 64BIT windows 7. Because I want to use pygame. Now, I also have downloaded pygame and have read the documentation for installing. I install pygame (after installing python). But when in python I run import pygame I get the the following error:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pygame
ImportError: No module named 'pygame'

How can should I skip this error?

EDITED ----------------

When I copy the pygame.msi installer in the pygame installation folder, and install it, and then run the import pygame command, I get the following error:

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

This is for future users:

I had installed python x86 version 3.3 and the pygame was version 2.8.

I installed pygame version 2.9(from bitbucket site), even without uninstalling the previous pygame, and it worked out. During the installation, if it finds the proper python installed, it will probably works, but if it does not find any installation, it probably will fail.

Py game for Win64bit 8.1

Do not download the 64 bit version of pygame from the website, instead click on the link in the bottom which says 'There are some pre release binaries for 64bit windows, and for python 2.7 at', it will open the unofficial downloads for python window. Then download the pygame-1.9.2a0-cp35-none-win32.whl. (Download the 32 bit although your windows is 64 bit.)

Follow these steps-

  • Rename the .whl file to .zip and extract the the three folders.

    Copy all the .h files in the pygame-----.data and paste it in the hard disk //Python3../include/pygame(New Folder).

    Go back to the .whl(downloaded) folder and copy the folders pygame...data and pygame..dist.

    Paste the above downloaded folders in the folder //Python3../lib/site-packages.

    Run Windows shell or command prompt as a admin and type python pip3install pygame.

    import python.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM