Skip to content

Conversation

Copy link

Copilot AI commented Jan 23, 2026

PyInstaller builds failed at runtime with ModuleNotFoundError for pytz, lap, and PIL.ImageGrab. These packages require explicit collection of timezone data, compiled C extensions, and platform-specific modules respectively.

Changes

Created PyInstaller hooks (hooks/ directory):

  • hook-pytz.py - Collects timezone database files via collect_data_files()
  • hook-lap.py - Collects compiled extensions via collect_dynamic_libs()
  • hook-PIL.py - Collects all PIL submodules including ImageGrab

Updated build configuration:

# CV_Studio.spec and build_exe.py
from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs

datas += collect_data_files('pytz')
datas += collect_data_files('PIL')

binaries = []
binaries += collect_dynamic_libs('lap')

a = Analysis(
    ...
    hookspath=['hooks'],
    ...
)

Added test script test_critical_imports.py to verify import resolution before build.

Documentation: English and French guides in FIX_EXE_IMPORTS_*.md with troubleshooting.

Affected Components

  • node.ActionNode.node_mongodb (pytz)
  • node.TrackerNode.mot.bytetrack.tracker.matching (lap)
  • node.VideoNode.node_screen_capture (PIL.ImageGrab)
Original prompt

quand j'execute le .exe, apres le buil j'ai un probleme d'import de pytz qui ne marche pas, lap no trouvé et imagegrab qui pose soucis. vérifie ça stp et fixe comme un pro


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits January 23, 2026 14:18
….exe

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
… PIL hook

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix import issues for pytz and imagegrab Add PyInstaller hooks for pytz, lap, and PIL.ImageGrab runtime imports Jan 23, 2026
Copilot AI requested a review from hackolite January 23, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants