Cx_Freeze pygame compiled file doesn't work - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Cx_Freeze pygame compiled file doesn't work

PedroForliPedroForli Posts: 4Member
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)
Sign In or Register to comment.