[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] pygame and py2exe problem !!
- To: pygame-users@xxxxxxxx
- Subject: [pygame] pygame and py2exe problem !!
- From: Alex <magobin@xxxxxxxxx>
- Date: Mon, 20 Jul 2009 18:26:52 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Mon, 20 Jul 2009 12:26:56 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=V8+BRYahAln8jYbqVZf8wXJY3+tZ08pdX1+4knb11A4=; b=KLCf8C90tdzmFfPgSFtMeQfmKUgh5RIk3CBhE55FgEgsuUHd+O8fTJ8mfRudd/vyWD nFMGImnR4MhAjr6l+Hg+0em3I9uF1B4diSYxeF2kXZ/8XDvUGW08TX4Fjm/Ctl8TO6KM jkolZL81DSv+b61bWxwzo+FAH7eiC+tJddx4A=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=d33kH4U7KaDdehvwupHipO3dhmOFFUmtoanlfweiyQ3OX2erzNuP0vHZwZyvPPEeDe 3ZLOjPPwSmUFp6M9eQsyWjyqeO7+Of77njRcmLdta7C0X3JTrcNIPki5bksHBY+wGm6x 8i6pbNl5t1Fg0rA6sD1gqOQSM1jlUYftABVis=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
hi at all,
As email object I 'm not be able to run my program when compiled with
py2exe.
Everythink works fine until I try to make an exe.
After that, it crash and in the log:
C:\dist\sponge.exe:97: RuntimeWarning: use mixer: DLL load failed: The
specified module could not be found.
Traceback (most recent call last):
File "sponge.py", line 97, in <module>
File "pygame\__init__.pyo", line 70, in __getattr__
NotImplementedError: mixer module not available
The code about pygame.mixer is only:
pygame.mixer.init()
music = pygame.mixer.Sound("popcorn.ogg")
music.play()
in the dist folder there is SDL_mixer.dll so...HOW can I solve this
problem ??
thanks in advance
Alex
Below my setup.py
# py2exe setup program
from distutils.core import setup
import py2exe
import pygame
from modulefinder import Module
#from pygame import mixer
import ImageGrab
import sys
import os
import Tkinter
import glob, shutil
sys.argv.append("py2exe")
VERSION = '1.0'
AUTHOR_NAME = 'Your Name'
AUTHOR_EMAIL = 'your_em...@xxxxxxxxxxxxx'
AUTHOR_URL = "http://www.urlofyourgamesite.com/"
PRODUCT_NAME = "Sponge"
SCRIPT_MAIN = 'sponge.py'
VERSIONSTRING = PRODUCT_NAME + " ALPHA " + VERSION
ICONFILE = 'icon.ico'
# Remove the build tree on exit automatically
REMOVE_BUILD_ON_EXIT = True
if os.path.exists('dist/'): shutil.rmtree('dist/')
extra_files = [ ("",[ICONFILE,'WinLockDll.dll','popcorn.ogg']),
#("data",glob.glob(os.path.join('data','*.dat'))),
#("gfx",glob.glob(os.path.join('gfx','*.jpg'))),
#("gfx",glob.glob(os.path.join('gfx','*.png'))),
("fonts",glob.glob(os.path.join('fonts','*.ttf'))),
("music",glob.glob(os.path.join('music','*.ogg')))]
#("snd",glob.glob(os.path.join('snd','*.wav')))]
# List of all modules to automatically exclude from distribution build
# This gets rid of extra modules that aren't necessary for proper
functioning of app
# You should only put things in this list if you know exactly what you
DON'T need
# This has the benefit of drastically reducing the size of your dist
MODULE_EXCLUDES =[
'email',
'AppKit',
'Foundation',
'bdb',
'difflib',
'tcl',
#'Tkinter',
#'Tkconstants',
'curses',
'distutils',
'setuptools',
'urllib',
'urllib2',
'urlparse',
'BaseHTTPServer',
'_LWPCookieJar',
'_MozillaCookieJar',
'ftplib',
'gopherlib',
'_ssl',
'htmllib',
'httplib',
'mimetools',
'mimetypes',
'rfc822',
'tty',
'webbrowser',
'socket',
'hashlib',
#'base64',
'compiler',
'pydoc'
]
INCLUDE_STUFF = ['encodings',"encodings.latin_1"]
setup(windows=[
{'script': SCRIPT_MAIN,
'other_resources': [(u"VERSIONTAG",1,VERSIONSTRING)],
'icon_resources': [(1,ICONFILE)]}],
options = {"py2exe": {
"optimize": 2,
"includes": INCLUDE_STUFF,
"compressed": 1,
"ascii": 1,
#"bundle_files": 1,
"ignores":
['tcl','AppKit','Numeric','Foundation'],
"excludes": MODULE_EXCLUDES} },
name = PRODUCT_NAME,
version = VERSION,
data_files = extra_files,
#zipfile = None,
author = AUTHOR_NAME,
author_email = AUTHOR_EMAIL,
url = AUTHOR_URL)
# Create the /save folder for inclusion with the installer
#shutil.copytree('save','dist/save')
#if os.path.exists('dist/tcl'): shutil.rmtree('dist/tcl')
# Remove the build tree
if REMOVE_BUILD_ON_EXIT:
shutil.rmtree('build/')
if os.path.exists('dist/tcl84.dll'): os.unlink('dist/tcl84.dll')
if os.path.exists('dist/tk84.dll'): os.unlink('dist/tk84.dll')