惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
IT之家
IT之家
D
Docker
博客园 - 叶小钗
A
About on SuperTechFans
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
Recorded Future
Recorded Future
Stack Overflow Blog
Stack Overflow Blog
腾讯CDC
V
V2EX
S
SegmentFault 最新的问题
量子位
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
Latest news
Latest news
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
有赞技术团队
有赞技术团队
The GitHub Blog
The GitHub Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
DataBreaches.Net
G
GRAHAM CLULEY
P
Proofpoint News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Y
Y Combinator Blog
小众软件
小众软件
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
aimingoo的专栏
aimingoo的专栏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
I
Intezer
Last Week in AI
Last Week in AI
T
Threatpost
人人都是产品经理
人人都是产品经理
U
Unit 42
Security Latest
Security Latest
AWS News Blog
AWS News Blog
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
罗磊的独立博客
GbyAI
GbyAI
P
Palo Alto Networks Blog
G
Google Developers Blog
MyScale Blog
MyScale Blog
L
LangChain Blog

博客园 - 逸乐太子

豆包无水印图片下载器|新媒体运营、自媒体创作者必备神器 免费无广告!网易UU远程,解锁远程办公、娱乐、运维全能玩法 告别手动复制!公众号文章批量导出工具,极致提升内容运营效率 高效办公神器:可视化Excel文档合并工具,告别手动复制粘贴 全国分省 Excel 爬取后,一键统计全文件数据行数|附即用型统计工具 某速体育网站中canvas数据获取 台风数据采集全攻略:从数据源到实操落地 豆包生成的图片带有AI字样怎么去除? 中国马拉松官方网站赛历信息采集工具 国家标准批量采集工具:全量元数据检索 + 批量导出 知网文献批量采集:BibTeX/EndNote 完整导出(含摘要、关键词、被引、全文链接) 超级课堂题库下载本地工具 洋葱智课在线题库导出工具 【python爬虫定制】PubScholar公益学术平台期刊名称爬取 【python数据采集】阳光高考学校信息采集 python程序的守护工具 【Python数据采集】国家自然科学基金大数据知识管理服务门户数据采集 使用python爬取豆瓣电影短评评论内容 使用 js 实现 urljoin 方法 使用 Python 爬取高校教师信息 python从PDF文件中读取国民经济行业分类 python爬虫之JS逆向某易云音乐 国务院办公厅放假通知信息获取 python爬虫之JS逆向 python爬虫之企某科技JS逆向 linux下telnet命令有时无法退出 H5中腾讯地图定位信息在安卓手机中获取不到
pyinstaller 打包时第三方模块与图片资源加载
逸乐太子 · 2023-04-20 · via 博客园 - 逸乐太子

打包命令

pyinstaller --onefile --windowed **.py

修改**.spec 文件

pathex=['/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ddddocr'],

datas=[('./images', 'images'),('/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ddddocr/common.onnx','ddddocr')],

在 hooks 目录中添加文件

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/hooks/hook-images.py

内容:

from PyInstaller.utils.hooks import collect_submodules, collect_data_files
datas = collect_data_files('images')

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/hooks/hook-ddddocr.py

from PyInstaller.utils.hooks import collect_submodules, collect_data_files
datas = collect_data_files('ddddocr')