I already pointed at the problem of exporting my pygame into an executable for distribution purpose. I still have the problem that when I run the setup.py (I use python version 3.7.0) and build the app, the app directly crashes and I cannot open the unix executable either. Here is exactly what I did so far:
my setup.py:
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
build_exe_options = {"include_files" : ["pic.png", "sound.wav"]} # there are more files, i.e. all pics and audio files used
import sys
base = 'Win32GUI' if sys.platform=='win32' else None
executables = [
Executable('pythonGame.py', base=base)
]
setup(name='MyGame',
version = '1.0',
description = 'blabla',
options = dict(build_exe = build_exe_options),
executables = executables)
when I run the setup.py to create stand-alone app via:
python setup.py bdist_mac
I get (many) error messages (cf. last 3 lines of terminal output):
> error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool:
> input file:
> build/GesaGame-1.0.app/Contents/MacOS/lib/pygame/pygame_icon.icns is
> not a Mach-O file @loader_path/.dylibs/libSDL-1.2.0.dylib error: can't
> copy '@loader_path/.dylibs/libSDL-1.2.0.dylib': doesn't exist or not a
> regular file
or further above
> error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool:
> input file: build/GesaGame-1.0.app/Contents/MacOS/RunningCleats.wav is
> not a Mach-O file
Nevertheless, the build folder has been created. When opening it I find the specified program, but it directly crashes after starting it. What am I doing wrong here? I suspect it has something to do with the included files, but I am not able to make sense of it.