Quantcast
Channel: Python - Programmers Heaven
Viewing all articles
Browse latest Browse all 140

Cx_Freeze pygame compiled file doesn't work

$
0
0
The following error happens if i try to compile my python (using python 3.2) file:

[code]
Traceback(most recent call last):
File
"c:python32libsite-packagescx_FreezeinitscriptsConsole3.py", line
27, in
exec(code, m.__dict__)
File "Abertura.py", line 208, in
File "Abertura.py", line 154, in main
File "Abertura.py", line 9, in __init__
pygame.error: Couldn't open
C:Python32uildexe.win32-3.2library.zipImagensmenu1.png[/code]

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
)
[/code]
And this is my setup.py file:

[code]
from cx_Freeze import setup, Executable

exe=Executable(
script="Abertura.py",
base="Win32Gui",
)
includefiles=[
('C:Python32Imagens','Imagens'),
('C:Python32Musicas','Musicas'),
('C:Python32Videos','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])
[/code]
How do i fix it?
(sorry about my possibles english mistakes)

Viewing all articles
Browse latest Browse all 140

Trending Articles