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.

Re: Problem with importing pygame 80 80

Did you install from a binary or from source?

Re: Problem with importing pygame 80 80

The binary.

Re: Problem with importing pygame 80 80

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

Re: Problem with importing pygame 80 80

Yeah. I installedK

pygame-1.9.1.win32-py3.1.msi

Re: Problem with importing pygame 80 80

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

Re: Problem with importing pygame 80 80

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).

Re: Problem with importing pygame 80 80

I haven't ever installed pygame before this.

Re: Problem with importing pygame 80 80

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.

Re: Problem with importing pygame 80 80

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).

Re: Problem with importing pygame 80 80

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.

Re: Problem with importing pygame 80 80

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

Re: Problem with importing pygame 80 80

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.

Re: Problem with importing pygame 80 80

i solve the problem for windows 64bit. I have the same issue and then notice that the downloads in the pygame web page are for windows 32bit, so you need to download for 64bit (i know, it sounds obvios) the downloads for 64bit in windows are here http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

Re: Problem with importing pygame 80 80

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 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.