I am new to Python and I am trying to import pygame. I am using Python 3.1 and I installed pygame 1.9.1 for python 3.1. When I try to import the module I get the following message:

Traceback (most recent call last):
  File "<pyshell#0>", 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: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

Does anyone know what I am doing wrong, or what I should do? I have already tried reinstalling it.

Recommended Answers

All 15 Replies

Did you install from a binary or from source?

The binary.

i take it you installed the binary for your version of python?

Yeah. I installedK

pygame-1.9.1.win32-py3.1.msi

try using:

import pygame
from pygame.base import *

if that still doesn't work try:

import pygame
from pygame.locals import *
from pygame.base import *

And if that fails, try installing from source, or down grading to Python 2.6.x

Of course you had not previously installed pygame or followed instrunctions:

You may need to uninstall old versions of pygame first.
NOTE: if you had pygame 1.7.1 installed already, please uninstall it first. Either using the uninstall feature - or remove the files: c:\python25\lib\site-packages\pygame . We changed the type of installer, and there will be issues if you don't uninstall pygame 1.7.1 first (and all old versions).

I haven't ever installed pygame before this.

I just installed successfully to my computer both 2.6 and 3.1 pygame.

Maybe you should uninstall and install pygame again?

Or run again the installs of python and pygame with repair option.

is there a file called base.pyd in Lib/site-packages? Maybe its a path error. Try opening the script from the command line with python. I.E. C:\python myProgram.py

Other than that, downgrade(opinion).

Other than that, downgrade(opinion). (Tech B)

I agree. I'm not upgrading to Python 3.x until there is full support for many of the modules.

But then again python 3 doesn't have much support for anything downgrade if that doesn't work.

you must download the right release,this`s to say, if you use python-3.2.2.msi you must download pygame-1.9.2a0.win32-py3.2.msi, when there is a new python, there`ll be a new pygame.

ivan.rodriguezsoria.7: Please check the dates on the thread you are posting to before posting. This thread is over three years old.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.