0
votes

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"]}})
1

1 Answers

0
votes

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