From a3f61ea177a13acdf02f041a09016b4cdf20b998 Mon Sep 17 00:00:00 2001 From: jknapp Date: Sun, 28 Dec 2025 19:49:45 -0800 Subject: [PATCH] Fix PyInstaller hook error for webrtcvad package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PyInstaller's default webrtcvad hook was failing because we use webrtcvad-wheels (which provides the webrtcvad module but has a different package name for metadata purposes). Changes: - Created hooks/hook-webrtcvad.py custom hook - Tries to copy metadata from webrtcvad-wheels first - Falls back to webrtcvad if needed - Gracefully handles missing metadata (module still works) This prevents the "PackageNotFoundError: No package metadata was found for webrtcvad" error during PyInstaller build. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- hooks/hook-webrtcvad.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 hooks/hook-webrtcvad.py diff --git a/hooks/hook-webrtcvad.py b/hooks/hook-webrtcvad.py new file mode 100644 index 0000000..729bde6 --- /dev/null +++ b/hooks/hook-webrtcvad.py @@ -0,0 +1,25 @@ +""" +PyInstaller hook for webrtcvad. + +The webrtcvad-wheels package provides webrtcvad module but uses a different +package name, causing PyInstaller's default hook to fail. This custom hook +handles the metadata correctly. +""" + +from PyInstaller.utils.hooks import copy_metadata + +# Try to copy metadata from webrtcvad-wheels (the actual package name) +# Fall back gracefully if not found +try: + datas = copy_metadata('webrtcvad-wheels') +except Exception: + # If webrtcvad-wheels metadata not found, try webrtcvad + try: + datas = copy_metadata('webrtcvad') + except Exception: + # If neither found, that's okay - the module will still work + datas = [] + +# Ensure webrtcvad binary extensions are included +hiddenimports = [] +binaries = []