Hi,
I'm trying to put together a very simple GUI application using pysimplegui (based on tkinter) and package it as an executable using pyoxidizer. The main script is quite simple:
import PySimpleGUI as sg
layout = [[sg.Text("Text")]]
window = sg.Window(title="Gui", layout=layout)
window.read()
And I am using a pretty basic bzl file. Before running pyoxidizer run I have packaged the Python script as a wheel. Building seems to commence without issues, but I get an error at the very end: "Error: cargo run failed". There are no other error messages in the console. The resulting "lib" folder correctly containes lots of TCL and tkinter related libraries. Do you have any ideas for how I should proceed?
Thanks.
pyoxidizer.bzl:
def make_dist():
return default_python_distribution()
def make_exe(dist):
policy = dist.make_python_packaging_policy()
python_config = dist.make_python_interpreter_config()
python_config.run_module = "client.gui_test"
exe = dist.to_python_executable(
name="gui",
packaging_policy=policy,
config=python_config,
)
# Install tcl/tk support files to a specified directory so the `tkinter` Python
# module works.
exe.tcl_files_path = "lib"
exe.windows_subsystem = "windows"
exe.add_python_resources(exe.pip_install(
["dist\\gui-0.0.1-py2.py3-none-any.whl"]
))
return exe
def make_embedded_resources(exe):
return exe.to_embedded_resources()
def make_install(exe):
# Create an object that represents our installed application file layout.
files = FileManifest()
# Add the generated executable to our install layout in the root directory.
files.add_python_resource(".", exe)
return files
# Tell PyOxidizer about the build targets defined above.
register_target("dist", make_dist)
register_target("exe", make_exe, depends=["dist"])
register_target("resources", make_embedded_resources, depends=["exe"], default_build_script=True)
register_target("install", make_install, depends=["exe"], default=True)
# Resolve whatever targets the invoker of this configuration file is requesting
# be resolved.
resolve_targets()
# END OF COMMON USER-ADJUSTED SETTINGS.
#
# Everything below this is typically managed by PyOxidizer and doesn't need
# to be updated by people.
PYOXIDIZER_VERSION = "0.10.3"
PYOXIDIZER_COMMIT = "UNKNOWN"