Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
Oil_Level_Recognition_System
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Oil_Level_Recognition_System
Commits
81c47ac5
Commit
81c47ac5
authored
Nov 30, 2025
by
Yuhaibo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d05197f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
1.spec
1.spec
+6
-6
No files found.
1.spec
View file @
81c47ac5
...
...
@@ -311,7 +311,7 @@ exe = EXE(
target_arch
=
None
,
codesign_identity
=
None
,
entitlements_file
=
None
,
icon
=
os
.
path
.
join
(
project_root
,
'icons'
,
'
logo.ico
'
),
# exe文件图标和任务栏图标
icon
=
os
.
path
.
join
(
project_root
,
'icons'
,
'
apple.png
'
),
# exe文件图标和任务栏图标
)
# ============================================================================
...
...
@@ -338,7 +338,7 @@ coll = COLLECT(
1. 安装PyInstaller:pip install pyinstaller
2. 运行打包命令:pyinstaller 1.spec
3. 打包输出位置:dist/帕特智能油液位检测/
- 帕特智能油液位检测.exe (主程序,带
logo
图标)
- 帕特智能油液位检测.exe (主程序,带
apple
图标)
- _internal/ (依赖文件夹)
分离式打包的优势:
...
...
@@ -348,9 +348,9 @@ coll = COLLECT(
4. 易于调试(可以看到所有依赖文件)
图标配置:
- icon:使用 icons/apple.
ico
作为exe文件图标
- icon:使用 icons/apple.
png
作为exe文件图标
- 同时设置任务栏图标(Windows自动从exe图标提取)
- 支持
ICO格式
- 支持
PNG格式(PyInstaller会自动转换为ICO格式)
控制台调试模式:
- console=True:显示控制台窗口,可以看到print输出和错误信息
...
...
@@ -365,13 +365,13 @@ coll = COLLECT(
5. ultralytics数据文件已排除,避免_internal中出现ultralytics文件夹
6. 模型推理功能通过核心模块导入保证正常工作
7. 如果缺少某些DLL,可以手动复制到_internal目录
8. 图标文件必须存在于 icons/
logo.ico
8. 图标文件必须存在于 icons/
apple.png
常见问题解决:
1. 缺少模块:添加到hiddenimports列表
2. 缺少DLL:添加到binaries列表或手动复制
3. 缺少数据文件:添加到datas列表
4. 程序无法启动:检查控制台输出的错误信息
5. 图标不显示:确保 icons/
logo.ico
存在且格式正确
5. 图标不显示:确保 icons/
apple.png
存在且格式正确
"""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment