mirror of
https://github.com/moesnow/March7thAssistant.git
synced 2026-08-02 18:24:16 +08:00
PyInstaller 无法追踪 selenium 内部动态导入的子模块, 导致打包后开启云游戏时报错 No module named 'selenium.webdriver.chrome.webdriver'。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
70 lines
1.7 KiB
Python
70 lines
1.7 KiB
Python
# -*- mode: python ; coding: utf-8 -*-
|
|
from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs
|
|
|
|
binaries = []
|
|
datas = []
|
|
|
|
binaries += collect_dynamic_libs('openvino', search_patterns=['openvino_intel_cpu_plugin.dll', 'openvino_onnx_frontend.dll'])
|
|
|
|
datas += collect_data_files('rapidocr')
|
|
|
|
|
|
a = Analysis(
|
|
['main.py'],
|
|
pathex=[],
|
|
binaries=binaries,
|
|
datas=datas,
|
|
hiddenimports=[
|
|
'selenium.webdriver.chrome.webdriver',
|
|
'selenium.webdriver.chrome.service',
|
|
'selenium.webdriver.chrome.options',
|
|
'selenium.webdriver.edge.webdriver',
|
|
'selenium.webdriver.edge.service',
|
|
'selenium.webdriver.edge.options',
|
|
'selenium.webdriver.chromium.webdriver',
|
|
'selenium.webdriver.chromium.service',
|
|
'selenium.webdriver.chromium.options',
|
|
'selenium.webdriver.remote.webdriver',
|
|
'selenium.webdriver.remote.connection',
|
|
'selenium.webdriver.common.service',
|
|
'selenium.webdriver.common.selenium_manager',
|
|
],
|
|
hookspath=[],
|
|
hooksconfig={},
|
|
runtime_hooks=[],
|
|
excludes=['PySide6'],
|
|
noarchive=False,
|
|
optimize=0,
|
|
)
|
|
pyz = PYZ(a.pure)
|
|
|
|
exe = EXE(
|
|
pyz,
|
|
a.scripts,
|
|
[],
|
|
exclude_binaries=True,
|
|
name='March7th Assistant',
|
|
debug=False,
|
|
bootloader_ignore_signals=False,
|
|
strip=False,
|
|
upx=True,
|
|
console=True,
|
|
disable_windowed_traceback=False,
|
|
argv_emulation=False,
|
|
target_arch=None,
|
|
codesign_identity=None,
|
|
entitlements_file=None,
|
|
uac_admin=True,
|
|
icon=['assets\\logo\\Terminal.ico'],
|
|
contents_directory='libraries',
|
|
)
|
|
coll = COLLECT(
|
|
exe,
|
|
a.binaries,
|
|
a.datas,
|
|
strip=False,
|
|
upx=True,
|
|
upx_exclude=[],
|
|
name='March7th Assistant',
|
|
)
|