Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solving "DLL load failed: %1 is not a valid Win32 application." for Pygame

Tags:

python

pygame

I installed Python 3.1 and the Pygame module for Python 3.1. When I type import python in the console I get the following error:

Traceback (most recent call last):   File "<pyshell#2>", line 1, in <module>     import pygame   File "C:\Python31\lib\site-packages\pygame\__init__.py", line 95, in <module>     from pygame.base import * ImportError: DLL load failed: %1 is not a valid Win32 application. 
like image 433
Parseltongue Avatar asked Jan 13 '11 03:01

Parseltongue


People also ask

How do you fix Importerror DLL load failed the specified module could not be found?

importerror: dll load failed: The specified module could not be found error occurs because of the incompatibilities of Microsoft Visual C++ (Visual studio) versions. The best way to fix this error (importerror: dll load failed) is to reinstall/ install the Microsoft Visual C++ distribution.

What is 1 is not a valid Win32 application?

In most cases, the “1 is not a valid Win32 application” occurs due to the incompatibility between the Windows version/type and program. Please make sure you have downloaded the right version of the installer file. Press Windows key + R to call out the Run box.


1 Answers

It could be due to the architecture of your OS. Is your OS 64 Bit and have you installed 64 bit version of Python? It may help to install both 32 bit version Python 3.1 and Pygame, which is available officially only in 32 bit and you won't face this problem.

I see that 64 bit pygame is maintained here, you might also want to try uninstalling Pygame only and install the 64 bit version on your existing python3.1, if not choose go for both 32-bit version.

like image 128
Senthil Kumaran Avatar answered Sep 20 '22 12:09

Senthil Kumaran