Cx_Freeze compiled pygame File doesn't work


Pedro H. Forli

Still Fresh
Joined
Aug 1, 2013
Messages
3
The following error happens if i try to compile my python (using python 3.2) file:


Code:
Traceback(most recent call last):
File
"c:\python32\lib\site-packages\cx_Freeze\initscripts\Console3.py", line
27, in <module>
  exec(code, m.__dict__)
 File "Abertura.py", line 208, in <module>
 File "Abertura.py", line 154, in main
 File "Abertura.py", line 9, in __init__
 pygame.error: Couldn't open
C:\Python32\build\exe.win32-3.2\library.zip\Imagens\menu1.png

I already included pygame._view and tried to copy the 'Imagens' directory to the library.zip file, but it doesn't work. I'm using images, musics and videos that come's from other directories by including in my code:


Code:
def file_path(filename, directory):
    return os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            directory,
            filename
        )

And this is my setup.py file:


Code:
from cx_Freeze import setup, Executable


exe=Executable(
     script="Abertura.py",
     base="Win32Gui",
     )
includefiles=[('C:\Python32\Imagens', 'Imagens'), ('C:\Python32\Musicas','Musicas'),('C:\Python32\Videos','Videos')]
includes=[]
excludes=[]
packages=[]
setup(
     version = "1.0",
     description = "RPG",
     author = "Pedro Forli e Ivan Veronezzi",
     name = "Batalha Inapropriada",
     options = {'build_exe': {'excludes':excludes,'packages':packages,'include_files':includefiles}},
     executables = [exe]
     )

How do i fix it?

(sorry about my possibles english mistakes)
 
Back
Top