PaddleOCR 用 pyinstaller 打包 exe

1 新建 打包文件

# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['showProject.py'],
     pathex=['D:\\Python38_64\\Lib\\site-packages\\paddleocr', 'D:\\Python38_64\\Lib\\site-packages\\paddle\\libs'],
     binaries=[('D:\\Python38_64\\Lib\\site-packages\\paddle\\libs', '.')],
     datas=[],
     hiddenimports=[],
     hookspath=['.'],
     runtime_hooks=[],
     excludes=['matplotlib'],
     win_no_prefer_redirects=False,
     win_private_assemblies=False,
     cipher=block_cipher,
     noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
     cipher=block_cipher)
exe = EXE(pyz,
     a.scripts,
     [],
     exclude_binaries=True,
     name='main',
     debug=False,
     bootloader_ignore_signals=False,
     strip=False,
     upx=True,
     console=True)
coll = COLLECT(exe,
     a.binaries,
     a.zipfiles,
     a.datas,
     strip=False,
     upx=True,
     upx_exclude=[],
     name='main')
2 修改 paddle/dataset/ image.py 

PaddleOCR 用 pyinstaller 打包 exe_第1张图片

3 pyinstaller -y -gui.spec

开始打包..

4 将 paddleocr 下的 ppocr 复制到 打包下 的 dist 

5 还要复制  skimage pywt 

 

你可能感兴趣的:(python)