Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyInstaller打包报错 #35

Open
monkeycc opened this issue Jul 17, 2024 · 3 comments
Open

PyInstaller打包报错 #35

monkeycc opened this issue Jul 17, 2024 · 3 comments

Comments

@monkeycc
Copy link


cd ./PPOCRLabel
# 安装pyinstaller
pip install pyinstaller

# 重新生成资源
pyrcc5 -o libs/resources.py resources.qrc

# 打包可执行程序
pyinstaller -c PPOCRLabel.py --collect-all paddleocr --collect-all pyclipper --collect-all imghdr --collect-all skimage --collect-all imgaug --collect-all scipy.io --collect-all lmdb --collect-all paddle --hidden-import=pyqt5  -p ./libs -p ./ -p ./data -p ./resources -F

# 运行dist中的可执行程序,以windows为例
PPOCRLabel.exe
Traceback (most recent call last):
  File "PPOCRLabel.py", line 66, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "paddleocr\__init__.py", line 14, in <module>
    from .paddleocr import *
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "paddleocr\paddleocr.py", line 60, in <module>
    from ppocr.utils.network import (
  File "C:\Users\mm\AppData\Local\Temp\_MEI355082\paddleocr\ppocr\utils\network.py", line 18, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
[27212] Failed to execute script 'PPOCRLabel' due to unhandled exception!
@GreatV
Copy link
Collaborator

GreatV commented Jul 17, 2024

paddleocr少了requests依赖

@monkeycc
Copy link
Author

说明打包教程有问题

官方应该推出打包好的程序
打包多费劲

@tlishi
Copy link

tlishi commented Dec 25, 2024

我打包完了之后,使用PPOCRLabel.exe --lang ch运行,就一直闪退,其他方式运行也会有闪退,
比如:
1.2.2 通过Python脚本运行PPOCRLabel
cd ./PPOCRLabel # 切换到PPOCRLabel目录
python PPOCRLabel.py --lang ch

1.2.1 通过whl包安装与运行
pip install PPOCRLabel # 安装

选择标签模式来启动

PPOCRLabel --lang ch # 启动【普通模式】,用于打【检测+识别】场景的标签

这是怎么回事?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants