Package your app
Your app works on your machine. Now you want to send it to someone who does not have Python, does not know what
pip is, and should be able to double-click it. This tutorial takes an app from a project folder to a file
you can share, and then to an automatic build for all three systems.
| Goal | Time | Level | You need |
|---|---|---|---|
| A double-clickable app for Windows, macOS and Linux | 30 minutes (plus build time) | Advanced · command line | uv installed, a GitHub account for the last part |
What you’ll learn
Section titled “What you’ll learn”- Create (or convert to) a Pyzed project: the layout
pyzed buildexpects. - Build a standalone executable for the system you are on.
- Add an icon, data files and a name, and read bundled files from your code.
- Build all platforms at once with GitHub Actions, and why signing matters.
-
Start from a project.
pyzed buildpackages a uv project whose main form or script is set inpyproject.toml. Create one (or open New project in Pyzed Design’s welcome window):Windows, macOS and Linux uvx --from pyzed-ui pyzed new my-appcd my-appuv run pyzed run # try itmacOS and Linux python -m pip install pyzed-uipyzed new my-app # uses uv under the hood: install it firstcd my-appuv run pyzed runWindows (PowerShell) python -m pip install pyzed-uipyzed new my-appcd my-appuv run pyzed runWith Pyzed already installed python -m pyzed new my-appAlready have a uv project? Run
pyzed initinside it. The UI lives inui/(forms and their handlers), the backend insrc/my_app/. -
Build for this computer. From the project folder:
Windows, macOS and Linux uv run pyzed buildmacOS and Linux source .venv/bin/activatepyzed buildWindows (PowerShell) .venv\Scripts\Activate.ps1pyzed buildInside the project's environment python -m pyzed buildThe first build takes a minute or two. The result goes to
dist/:Built on You get Share it as Windows dist\my-app\my-app.exeA zip of the folder, or an installer (Inno Setup, WiX) macOS dist/my-app.appA zip or a .dmg, signed and notarizedLinux dist/my-app/my-appA tarball, AppImage, .debor Flatpak -
Try it like a user would. Copy the folder somewhere else (or to another machine without Python) and open the executable. If it closes at once, build with
--consoleto see the error. -
Name, icon and data files. Add a
[tool.pyzed.build]table topyproject.toml:pyproject.toml [tool.pyzed.build]name = "Notes" # the executable's nameicon = "assets/icon.ico" # .ico on Windows, .icns on macOSinclude = ["assets", "data/help.md"] # files your app reads at run timeInside the bundle, find those files from the bundle’s root:
import sysfrom pathlib import PathROOT = Path(getattr(sys, "_MEIPASS", Path(__file__).resolve().parents[1]))help_text = (ROOT / "data" / "help.md").read_text() -
One file or a folder?
pyzed build --onefilemakes a single file, handy to send, but slower to start (it unpacks itself every time) and more often flagged by antivirus software. A folder plus an installer is the safer choice for a real release. -
Every platform from CI. A build only runs on the system it was made on, so you need Windows, macOS and Linux machines. GitHub has them:
Terminal window uv run pyzed build --workflow # writes .github/workflows/build.ymlgit add .github && git commit -m "Build on every platform" && git pushgit tag v1.0.0 && git push --tags # a v* tag starts the buildEach run keeps the three
dist/folders as downloadable artifacts.
- Build and distribute: what gets bundled, every option, troubleshooting.
- Build an app with the AI agent.