From be53f2e9626ff8a840f404e081676dc619da3c63 Mon Sep 17 00:00:00 2001 From: jknapp Date: Sun, 28 Dec 2025 19:06:33 -0800 Subject: [PATCH] Fix PyInstaller build failure caused by enum34 package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The enum34 package is an obsolete backport of Python's enum module and is incompatible with PyInstaller on Python 3.4+. It was being pulled in as a transitive dependency by pvporcupine (part of RealtimeSTT's dependencies). Changes: - All build scripts now remove enum34 before running PyInstaller - build.bat, build-cuda.bat (Windows) - build.sh, build-cuda.sh (Linux) - Added "uv pip uninstall -q enum34" step after cleaning builds - Removed attempted pyproject.toml override (not needed with this fix) This fix allows PyInstaller to bundle the application without errors while still maintaining all RealtimeSTT functionality (enum is part of Python stdlib since 3.4). Resolves: PyInstaller error "enum34 package is incompatible" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- build-cuda.bat | 4 ++++ build-cuda.sh | 4 ++++ build.bat | 4 ++++ build.sh | 4 ++++ pyproject.toml | 1 + 5 files changed, 17 insertions(+) diff --git a/build-cuda.bat b/build-cuda.bat index 4805aff..c6eaf56 100644 --- a/build-cuda.bat +++ b/build-cuda.bat @@ -29,6 +29,10 @@ echo Cleaning previous builds... if exist build rmdir /s /q build if exist dist rmdir /s /q dist +REM Remove enum34 if present (incompatible with PyInstaller) +echo Removing enum34 (if present)... +uv pip uninstall -q enum34 2>nul + REM Build with PyInstaller echo Running PyInstaller... uv run pyinstaller local-transcription.spec diff --git a/build-cuda.sh b/build-cuda.sh index fb1fc7f..0fee398 100755 --- a/build-cuda.sh +++ b/build-cuda.sh @@ -30,6 +30,10 @@ fi echo "Cleaning previous builds..." rm -rf build dist +# Remove enum34 if present (incompatible with PyInstaller) +echo "Removing enum34 (if present)..." +uv pip uninstall -q enum34 2>/dev/null || true + # Build with PyInstaller echo "Running PyInstaller..." uv run pyinstaller local-transcription.spec diff --git a/build.bat b/build.bat index e0f5c4c..441adff 100644 --- a/build.bat +++ b/build.bat @@ -10,6 +10,10 @@ echo Cleaning previous builds... if exist build rmdir /s /q build if exist dist rmdir /s /q dist +REM Remove enum34 if present (incompatible with PyInstaller) +echo Removing enum34 (if present)... +uv pip uninstall -q enum34 2>nul + REM Build with PyInstaller echo Running PyInstaller... uv run pyinstaller local-transcription.spec diff --git a/build.sh b/build.sh index b94d25f..aab9618 100755 --- a/build.sh +++ b/build.sh @@ -8,6 +8,10 @@ echo "=========================================" echo "Cleaning previous builds..." rm -rf build dist +# Remove enum34 if present (incompatible with PyInstaller) +echo "Removing enum34 (if present)..." +uv pip uninstall -q enum34 2>/dev/null || true + # Build with PyInstaller echo "Running PyInstaller..." uv run pyinstaller local-transcription.spec diff --git a/pyproject.toml b/pyproject.toml index f11b5f6..da272d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,6 +71,7 @@ torch = { index = "pytorch-cu121" } torchvision = { index = "pytorch-cu121" } torchaudio = { index = "pytorch-cu121" } + [tool.ruff] line-length = 100 target-version = "py39"