EXE working but getting logging error

This commit is contained in:
Brent Perteet
2025-10-25 11:52:11 -05:00
parent fe69dc6f19
commit de7041c1f5
3 changed files with 89 additions and 31 deletions

View File

@@ -6,8 +6,14 @@ block_cipher = None
import os
import sys
# Hardcode the venv esptool path since PyInstaller might run from different env
esptool_dir = os.path.join(os.path.dirname(SPECPATH), 'venv', 'Lib', 'site-packages', 'esptool')
# Find esptool installation dynamically
try:
import esptool
esptool_dir = os.path.dirname(esptool.__file__)
print(f"Found esptool at: {esptool_dir}")
except ImportError:
print("Warning: esptool not found, stub files will not be included")
esptool_dir = None
# Build datas list - include all esptool data files
datas_list = [
@@ -16,8 +22,10 @@ datas_list = [
]
# Add esptool targets directory (includes stub_flasher JSON files)
if os.path.exists(os.path.join(esptool_dir, 'targets')):
datas_list.append((os.path.join(esptool_dir, 'targets'), 'esptool/targets'))
if esptool_dir and os.path.exists(os.path.join(esptool_dir, 'targets')):
targets_dir = os.path.join(esptool_dir, 'targets')
datas_list.append((targets_dir, 'esptool/targets'))
print(f"Including esptool targets from: {targets_dir}")
a = Analysis(
['web_flasher.py'],