exe 依赖添加
This commit is contained in:
@@ -88,11 +88,25 @@ def build_exe(onefile: bool = False, console: bool = False):
|
||||
for sql_file in database_dir.glob("*.sql"):
|
||||
cmd.extend(["--add-data", f"{sql_file};database"])
|
||||
|
||||
# 收集完整模块(解决跨机器运行时缺少模块的问题)
|
||||
collect_all_modules = [
|
||||
"shiboken6", # PySide6 依赖,必须完整打包
|
||||
"PySide6", # Qt 绑定,必须完整打包
|
||||
]
|
||||
for mod in collect_all_modules:
|
||||
cmd.extend(["--collect-all", mod])
|
||||
|
||||
# 隐式导入
|
||||
hidden_imports = [
|
||||
# shiboken6 核心模块(解决 No module named 'shiboken6.Shiboken' 错误)
|
||||
"shiboken6",
|
||||
"shiboken6.Shiboken",
|
||||
# PySide6 核心模块
|
||||
"PySide6.QtCore",
|
||||
"PySide6.QtGui",
|
||||
"PySide6.QtWidgets",
|
||||
"PySide6.QtNetwork",
|
||||
# 数据库
|
||||
"psycopg2",
|
||||
"psycopg2.extras",
|
||||
"psycopg2.extensions",
|
||||
|
||||
Reference in New Issue
Block a user