This is a Pyside6 example project using Nuitka build for Windows and linux with Github Actions. Other operating systems are not supported by the developer of this repository.
Qt recommends Nuitka or Pyinstaller to create Pyside6 executables for deployment. Nuitka creates smaller executables compared with Pyinstaller, but Pyinstaller build is faster.
Download executables for Windows or Linux from:
- Github Releases (Recommended), or:
- Github Actions (development), open
a build and download
Linux Build
orWindows Build
underArtifacts
.
Linux installer:
No sudo
rights are required as the executable is installed in the user's home directory ~/.local/bin/erriez/
:
# Add executable flag after download with command:
$ chmod +x erriez-pyside6-app-linux-setup.run
# Run setup:
$ ./erriez-pyside6-app-linux-setup.run
Press `q` to quit license.
Please type y to accept, n otherwise: y
...
Start the application via desktop menu | Accessories.
Linux standalone application:
The Linux standalone executable can be started directly without sudo
or installation:
# Add executable flag after download with command:
$ chmod +x erriez-pyside6-app
# Start executable:
$ ./erriez-pyside6-app
Windows::
- Run
erriez-pyside6-app.exe
as portable standalone application, or: - Run
erriez-pyside6-app-setup.exe
to install on Windows (default:C:\Program Files\Erriez\
) which creates a shortcut in the start menu and desktop:
# Clone project
$ git clone https://github.com/Erriez/pyside6-nuitka-deployment.git
$ cd pyside6-nuitka-deployment
# Install Linux system dependencies
$ sudo apt install python3-virtualenv ccache clang patchelf
# Create virtual environment
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ pip install nuitka
Create single executable for Linux:
# Build executable for Linux
$ python3 -m nuitka \
--output-dir=dist \
--output-file=pyside6-app-linux \
--onefile \
--enable-plugin=pyside6 \
--include-data-dir=images=images \
main.py
# Start created executable
$ ./pyside6-app-linux
# Fix virtualenv issues
> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
# Build executable for Windows
> python -m nuitka `
--output-dir=dist `
--output-file=pyside6-app.exe `
--onefile `
--assume-yes-for-downloads `
--enable-plugin=pyside6 `
--include-data-dir=images=images `
--disable-console `
--windows-icon-from-ico=images/app.ico `
--company-name="Erriez Open Source Software" `
--product-name="PySide6 App" `
--file-version="1.0.0.0" `
--product-version="`1.0.0.0" `
--file-description="PySide6 Example App" `
--copyright="MIT (c) 2023 by Erriez" `
main.py
# Start created executable
> dist\pyside6-app.exe
# https://pypi.org/project/pyinstaller-versionfile/
> pip install pyinstaller pyinstaller-versionfile
> create-version-file --outfile version_info.txt version_info.yaml
> pyinstaller `
--distpath dist `
--name pyside6-app-pyinstaller.exe `
--noconfirm `
--onefile `
--noconsole `
--ico images\app.ico `
--add-data "images;images" `
--version-file version_info.txt `
main.py
- Download NSIS v3.
- Download NSIS Quick Setup Script Generator.
- Start
NSIS Quick Setup Script Generator.exe
and fill-in the wizard. - Copy generated file from
Output\App\*.nsi
to install.nsi and change to relative path / customize file.
Manual version updates are required in:
CHANGELOG.md
- Git tag in format
vx.x.x
Windows Defender and virusscanners such as https://www.virustotal.com/ shows false positives when building executable with Pyinstaller or Nuitka. This is a known issue.
This project is published under MIT license with an additional end user agreement (next section).
End users shall accept the End User Agreement holding export restrictions to Russia to stop the WAR before using this project.