pyoxidizer and pysimplegui

117 views
Skip to first unread message

Frank Olaf Sem-Jacobsen

unread,
Feb 27, 2021, 3:55:12 AM2/27/21
to pyoxidizer-users
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"

Gregory Szorc

unread,
Feb 27, 2021, 1:02:09 PM2/27/21
to Frank Olaf Sem-Jacobsen, pyoxidizer-users
That "Error: cargo run failed" error could mean something is busted with your Rust/Cargo install. But it is hard to know anything without the command output around that error message. Could you please reply with that content?

--
You received this message because you are subscribed to the Google Groups "pyoxidizer-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyoxidizer-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyoxidizer-users/77819d61-0157-4607-ac1e-98aef066fea3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages