0

I tried to make an exe from my programm in python using py2exe. My programm contains multiple sound- and image files. The problem is, that when I try to run the exe, it gives me an error:

C:\Users\Eduard\Desktop\testordner>test.exe
test.exe:7: RuntimeWarning: use mixer: DLL load failed: Das
angegebene Modul wurde nicht gefunden.
(ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.)
Traceback (most recent call last):
File "test.py", line 7, in <module>
mixer.init()
File "pygame\__init__.pyc", line 70, in __getattr__
NotImplementedError: mixer module not available
(ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.)

In my programm I'm also using the modules Tkinter, random, cycle from itertools and mixer from pygame. I mentioned them all in the setup file, but I dont know, if this is necessary. Here is the setup file too:

from distutils.core import setup
import Tkinter as tk
from itertools import cycle
from pygame import mixer
import random
import py2exe

setup(console=[{"script":"test.py"}],options={"py2exe":{"packages":["pygame"]}})
Duardo
  • 107
  • 11

1 Answers1

0

I think this happened because mixer isn't module it 's part of pygame edit line 7:

   pygame.mixer.init()

I may be wrong i'm begginer in pygame. EDIT: this happens often when using some pygame stuff sometimes it's solved by importing like this:

    import pygame.mixer

or you may try pygame2exe

NetSec
  • 85
  • 1
  • 1
  • 12
  • No only after turning the whole program in an .exe – Duardo Sep 23 '14 at 17:48
  • I had similar problem with pygame._view all worked till compilation i solved it with import pygame._view you could try import pygame.mixer – NetSec Sep 23 '14 at 17:51
  • Well, the I get this error `C:\Users\Eduard\Desktop\test>test.exe Traceback (most recent call last): File "test.py", line 3, in import pygame.mixer File "pygame\mixer.pyc", line 12, in File "pygame\mixer.pyc", line 10, in __load ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.` – Duardo Sep 23 '14 at 18:05
  • then I don't know what to say.I won't suggest reinstalling cause it could be waste of time.Maybe pygame2exe could help you [link]http://www.pygame.org/wiki/Pygame2exe – NetSec Sep 23 '14 at 18:11
  • No, I guess not because I have no pygame program. The GUI is build with Tkinter. I'm only using pygame for the sounds, thats all. – Duardo Sep 23 '14 at 20:38
  • Well the last option would be to use some other module just google python sound – NetSec Sep 24 '14 at 10:00