PaddleOCR
PaddleOCR copied to clipboard
No module named 'paddleocr'
问题描述 / Problem Description
写完了功能,需要把项目给非开发岗的同事用,但是打包后应用程序无法使用,报错No module named 'paddleocr'。文件配置如下:
运行环境 / Runtime Environment
spec
-- mode: python ; coding: utf-8 --
block_cipher = None
a = Analysis( ['server.py'], pathex=['.'], binaries=[], datas=[ ('PDF_output.py', '.'), ('Other_output.py', '.'), ('model/ch_ppocr_server_v2.0_det_infer', 'model/ch_ppocr_server_v2.0_det_infer'), ('model/ch_ppocr_server_v2.0_rec_infer', 'model/ch_ppocr_server_v2.0_rec_infer') ], hiddenimports=['paddleocr', 'tools'], # 添加 paddleocr 和 tools 模块到 hiddenimports hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], noarchive=False, optimize=0, )
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE( pyz, a.scripts, a.binaries, a.zipfiles, a.datas, [], name='server', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, upx_exclude=[], runtime_tmpdir=None, console=False, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, codesign_identity=None, entitlements_file=None, ) 上述代码中,server.py是运行的文件(相当于setup.py)包括分类和运行其他脚本,PDF_output.py和Other_output.py是对图像识别功能的脚本,检测和识别的模型文件均为ch_ppocr_server_v2.0
完整报错 / Complete Error Message
Traceback(most rencent call last):
File
"C:\Users\admin\AppData\Local_me191082\PDF_output.py",line 2, in