This guide explains how to build standalone executables for Wareflow Employee Management System that don't require Python installation.
Wareflow EMS can be distributed as standalone executables using PyInstaller. These executables bundle all dependencies and can run on any system without requiring Python installation.
- GUI Version (wems): Full-featured desktop application with CustomTkinter GUI
- CLI Version (wems-cli): Command-line interface for automation and scripting
- Windows 10/11:
.exeexecutable - Linux (Ubuntu 20.04+, Debian 11+): Binary executable
- macOS: (Coming soon - pending code signing setup)
- Python 3.14+ (for building only, not required for running the executable)
- uv - Fast Python package installer
pip install uv
- PyInstaller - Bundling tool
uv pip install pyinstaller
- Windows: Windows 10 or later with Visual C++ Redistributable
- Linux: Build essentials (gcc, g++, make)
- Disk Space: ~500 MB for dependencies and build artifacts
# Clone the repository
git clone https://github.com/wareflowx/wareflow-ems.git
cd wareflow-ems
# Install dependencies
uv sync --dev
# Install PyInstaller
uv pip install pyinstaller# Build GUI version (default)
python build/build.py
# Build CLI version
python build/build.py --cli
# Build both versions
python build/build.py --all
# Clean build (removes old artifacts)
python build/build.py --clean
# Skip tests (faster for development)
python build/build.py --skip-testsBuilt executables are located in dist/:
dist/
├── wems/
│ ├── wems.exe # Windows GUI executable
│ └── [supporting files]
├── wems-cli/
│ ├── wems-cli.exe # Windows CLI executable
│ └── [supporting files]
├── wems-version.txt # Version info
└── wems-cli-version.txt # Version info
python build/build.pyCreates a GUI application with:
- CustomTkinter interface
- Full feature set
- No console window
- Double-click to run
Output: dist/wems/wems.exe (Windows) or dist/wems/wems (Linux)
python build/build.py --cliCreates a command-line application with:
- All CLI commands
- Works in terminals
- Smaller file size
- Scriptable
Output: dist/wems-cli/wems-cli.exe (Windows) or dist/wems-cli/wems-cli (Linux)
python build/build.py --allBuilds both GUI and CLI versions in sequence.
python build/build.py --cleanRemoves all build artifacts before building, ensuring a fresh build.
python build/build.py --version 1.2.3Overrides the automatic version detection.
Configuration for the GUI executable:
- Entry point:
src/main.py - Includes: CustomTkinter, GUI modules, all dependencies
- Windowed: No console shown
- Icon:
build/assets/icon.ico
Configuration for the CLI executable:
- Entry point:
src/cli_main.py - Includes: CLI modules, excludes GUI frameworks
- Console: Shows terminal output
- Smaller size: GUI modules excluded
Each build generates SHA256 checksums:
# Windows
certutil -hashify SHA256 dist/wems/wems.exe
# Linux
sha256sum dist/wems/wemsChecksums are saved as dist/wems.exe.sha256 for verification.
Version information is injected during build:
cat dist/wems-version.txtOutput:
Wareflow Employee Management System
Version: 1.2.3
Build Type: GUI
Build Date: 2025-01-23T12:00:00
Platform: win32
Python: 3.14.2
# Windows
dist\wems\wems.exe
# Linux
chmod +x dist/wems/wems
./dist/wems/wems# Windows
dist\wems-cli\wems-cli.exe --help
# Linux
chmod +x dist/wems-cli/wems-cli
./dist/wems-cli/wems-cli --help- Launch the executable
- Verify main window opens
- Try adding an employee
- Check database operations
- Test Excel import/export
-
Run full build:
python build/build.py --all --clean
-
Verify checksums:
cat dist/wems/*.sha256 cat dist/wems-cli/*.sha256
-
Test on clean system:
- Copy to a machine without Python
- Verify it runs correctly
- Test all major features
-
Package for distribution:
# Create release package mkdir release cp dist/wems/wems.exe release/ cp dist/wems-cli/wems-cli.exe release/ cat dist/wems/*.sha256 > release/checksums.txt cat dist/wems-cli/*.sha256 >> release/checksums.txt cp README.md release/ cp LICENSE release/
Automated builds via GitHub Actions:
-
Push a tag:
git tag v1.2.3 git push origin v1.2.3
-
GitHub Actions automatically:
- Builds executables for all platforms
- Runs tests
- Generates checksums
- Creates GitHub Release
- Uploads artifacts
-
Download from:
https://github.com/wareflowx/wareflow-ems/releases
Issue: ModuleNotFoundError: No module named 'customtkinter'
Solution:
uv sync
uv pip install customtkinterIssue: ImportError: DLL load failed
Solution: Install Visual C++ Redistributable:
- Download from Microsoft
- Install and restart
Issue: Icon not found
Solution:
python build/create_icon.pyIssue: Double-clicking does nothing
Solution: Run from command line to see error:
# Windows
cd dist\wems
wems.exe
# Linux
cd dist/wems
./wemsIssue: "Application failed to start"
Solution:
- Verify all supporting files are present
- Check antivirus isn't blocking it
- Try running as administrator
Issue: Database errors
Solution:
- Ensure data directory exists
- Check file permissions
- Verify database isn't corrupted
Issue: Executable is too large (> 150 MB)
Solution:
- Check what's included in the spec file
- Add more packages to
excludeslist - Use UPX compression (enabled by default)
- Consider one-file vs directory build
Issue: Executable is too small (< 20 MB)
Solution:
- Something likely failed during build
- Check build logs for errors
- Verify all dependencies were bundled
SmartScreen Warning: Windows shows "Unrecognized app" warning
Solution: This is expected for unsigned executables. Users need to click "More info" → "Run anyway".
Antivirus Blocks: Antivirus software flags the executable
Solution:
- Add to antivirus exclusions
- Submit to Microsoft SmartScreen for whitelist
- Sign the executable (code signing certificate required)
Permission Denied: Can't execute the binary
Solution:
chmod +x dist/wems/wemsMissing Libraries: Error about missing .so files
Solution:
# Install missing dependencies
sudo apt-get install libxcb-xinerama0 libxcb-cursor0Gatekeeper Blocks: "can't be opened because it is from an unidentified developer"
Solution: Code signing is required for distribution. This is not yet implemented.
- Edit
build/create_icon.py - Change colors, text, or design
- Regenerate icons:
python build/create_icon.py
Edit build/wems.spec or build/wems-cli.spec:
Add hidden imports:
hiddenimports = [
"your.module",
"another.module",
]Exclude packages:
excludes = [
"unwanted.package",
]Include data files:
datas = [
("path/to/data", "data"),
]For a single-file executable (not recommended - slower startup):
In spec file, change:
exe = EXE(
...
exclude_binaries=False, # Changed from True
...
)
# Remove the COLLECT sectionEnable UPX compression (enabled by default):
exe = EXE(
...
upx=True,
upx_exclude=[],
...
)The .github/workflows/build.yml workflow automatically builds executables on:
- Git tags: Push
v*.*.*tag to trigger build - Manual trigger: Use GitHub Actions "Run workflow" button
The workflow:
- Builds on Windows and Linux
- Runs tests
- Generates checksums
- Creates GitHub Release
- Uploads artifacts
-
Exclude unused modules:
excludes = ["matplotlib", "numpy", "pandas"]
-
Use UPX compression: Enabled by default
-
Strip symbols:
exe = EXE( ... strip=True, ... )
-
Use directory build instead of one-file
- One-file: Must unpack every run
- Directory: Faster startup
-
Optimize imports:
- Remove unused imports in source code
- Lazy load heavy modules
-
Always test on clean system
- Build on development machine
- Test on machine without Python
- Verify all features work
-
Version your builds
- Use semantic versioning
- Tag releases in git
- Keep build artifacts
-
Generate checksums
- Always provide SHA256 checksums
- Document in release notes
- Users can verify integrity
-
Keep builds reproducible
- Use same Python version
- Lock dependency versions
- Document build environment
-
Test before release
- Run full test suite
- Manual testing of GUI
- Test on target platforms
For issues or questions:
- Documentation: See docs/
- GitHub Issues: Report a problem
- Discussions: Ask a question
- INSTALL.md - Installation guide
- RELEASE_PROCESS.md - Release process
- pyproject.toml - Project configuration