Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pygame in Windows: ImportError: DLL load failed

I just installed PyGame 1.9.1 (onto an existing python 2.6.4). Python and it standard libraries work, however, there is a problem with python even being able to find the pygame modules (correctly).

Traceback (most recent call last):
  File "C:\foo\bar\firstGame.py", line 2, in <module>
    import pygame
  File "C:\python264\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.

Why is is this happening? Googling yielded the following responses, which I have tried to no avail:

  • http://www.daniweb.com/forums/thread181323.html I have checked that indeed base.pyd can be found in C:\python264\lib\site-packages\pygame
  • http://www.kelvinsthunderstorm.com/py2exe-and-pygame-dlls/ The problem appears to be not that only select DLLs are missing, but rather that all of them are

Anyone out there fixed problems in win + pygame?

Thanks


EDIT: more information added as requested:
- Windows version: Windows Vista (updated regularly)
- Installer used: Windows MSI installers
- Installed for: All users
- Number of files in C:\python264\lib\site-packages\pygame:

  • DLL : 14
  • PYD : 34
  • PY : 19
  • PYC : 1
like image 813
bguiz Avatar asked Dec 28 '09 13:12

bguiz


2 Answers

Are you sure you have got pygame for Python 2.6? The version for 2.5 wont work and produce this error msg, because the pyd file wont find the python 2.5 dll.

like image 172
tillsten Avatar answered Oct 10 '22 04:10

tillsten


I have faced this error on a Windows 64 bit. I have uninstalled my python 3.4.1 and I have installed: python-3.4.1.amd64.msi then pygame-1.9.2a0.win-amd64-py3.4.exe from link mentioned above. And it worked.

like image 21
Mihai Avatar answered Oct 10 '22 02:10

Mihai