Skip to main content
This guide covers the complete process of building meikipop from source, including creating standalone executables for distribution.

Prerequisites

Before building, ensure you have:

Running from source

For development and testing, always run meikipop as a module:
The project includes convenience scripts:
  • meikipop.run.bat (Windows) - Runs from source
  • meikipop.install.bat (Windows) - Installs dependencies

Building executables with PyInstaller

Meikipop uses PyInstaller to create standalone executables that bundle Python and all dependencies into a single file.

Install PyInstaller

Understanding the spec files

Meikipop includes platform-specific PyInstaller spec files that configure the build process:
  • meikipop.win.x64.spec - Windows 64-bit
  • meikipop.linux.x64.spec - Linux 64-bit

Windows spec file breakdown

Here’s the meikipop.win.x64.spec configuration:
OCR providers are included as data files because they’re discovered dynamically at runtime using importlib. Without explicit inclusion, PyInstaller would miss them.

Executable configuration

Build process

Distribution package structure

A complete distribution should include:
The executable will not work without jmdict_enhanced.pkl in the data/ subdirectory. The app will exit with “Failed to load dictionary” error.

Build optimization

Reducing executable size

The default build can be quite large (100+ MB). To optimize:

Troubleshooting builds

A module wasn’t included in the build. Check:
  1. Is it in hiddenimports in the spec file?
  2. Are there any dynamically imported modules?
Add missing imports to hiddenimports:
Icons aren’t being bundled correctly. Verify the datas section includes:
And ensure the icon files exist in src/resources/.
OCR provider modules weren’t included as data files. The spec must include:
  1. All .py files in datas list
  2. Provider packages in hiddenimports list
See the Windows spec file for the complete list.
The executable can’t find jmdict_enhanced.pkl. Make sure:
  1. The data/ folder exists next to the executable
  2. jmdict_enhanced.pkl is inside data/
  3. The file has read permissions
Common causes:
  • ONNX runtime version mismatch (pinned to 1.20.1 for Windows)
  • Missing Visual C++ Redistributables
Try:
The executable was built on a system with different library versions. PyInstaller bundles libraries, but sometimes they conflict.Solutions:
  • Build on the oldest Linux version you want to support
  • Or build in a Docker container with specific library versions

Advanced: Custom builds

Adding custom OCR providers

If you’ve created a custom OCR provider, include it in the build:

Building with debug logging

For troubleshooting, enable console output:

Creating distributable archives

Once you have a working build, create an archive for distribution:

Next steps

After building:
  • Test on a clean system without Python installed
  • Verify all OCR providers work
  • Check the system tray and settings dialog
  • Test with different hotkey configurations
  • Distribute to users!
For official releases, builds should be created on GitHub Actions to ensure reproducibility and consistency across platforms.