Hi, I have tried to compiled a python file with pygame module into a exe file. I have written game2exe.py and I read some articles online which told me to include the "msvcp71.dll", "dwmapi.dll" files to my python:
def isSystemDLL(pathname):
if os.path.basename(pathname).lower() in ("msvcp71.dll", "dwmapi.dll"):
return 0
return origIsSystemDLL(pathname)
Then, I got the error messages like
The following modules appear to be missing:
AppKit, Foundation, ICCProfile, Numeric, OpenGL.GL, __imaging_gif, scproxy, copyreg, dummy.process, numpy, pkg_resorces, quitueue, winreg, pygame-sdlmain_osx
I tried to include:
self.extra_datas = ["kaiu.ttf",
"ARIALUNI.TTF",
'images/cards',
'images',
'sounds',
'pygame'
'Manifests'
]
These files contains both modules and resource of my program, but in the end, when I click on the blackjack.exe, it replies me a blank screen with nothing going on.
In the Manifests folder, I have include:
Microsoft.VC90.CRT.manifest
msvcm90.dll
msvcp90.dll
msvcr90.dll
I also tried to compiled setup.py with py2exe:
from distutils.core import setup
import py2exe,sys,os
import pygame
setup(console=['blackjack.py'])
origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
if os.path.basename(pathname).lower() in ("msvcp71.dll", "dwmapi.dll"):
return 0
return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL
It works fine until the end, but when I click the blackjack.exe, it returns to me:
file "pygame\___init__pyc", line 263 in moduleattributeError:imageext
Thanks.