You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
用pyinstaller 打包后报错 A dependency error occurred during pipeline creation. Please refer to the installation documentation to ensure all required dependencies are installed.
#17277
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
正常可以运行,用pyinstaller打包后运行缺少依赖,在github上找到一些方法,使用了一下,依旧报这错误,下面是我的打包代码
`# -- mode: python ; coding: utf-8 --
import sys
import os
from PyInstaller.utils.hooks import collect_data_files, copy_metadata
from PyInstaller.building.api import PYZ, EXE, COLLECT
sys.setrecursionlimit(50000)
block_cipher = None
BASE_DIR = os.path.abspath('.')
binaries = [
(r'D:\Project\Python\PythonProject.venv\Lib\site-packages\paddle', '.'),
(r'D:\Project\Python\PythonProject.venv\Lib\site-packages\paddlex', '.'),
(r'D:\Project\Python\PythonProject.venv\Lib\site-packages\paddleocr', '.'),
]
datas = (
collect_data_files("paddlex") +
collect_data_files("Cython", includes=["Utility/.c", "Utility/.cpp", "Utility/.h", "Utility/.pxd","Utility/*.pyx"]) +
copy_metadata("ftfy") +
copy_metadata("imagesize") +
copy_metadata("lxml") +
copy_metadata("opencv-contrib-python") +
copy_metadata("openpyxl") +
copy_metadata("premailer") +
copy_metadata("pyclipper") +
copy_metadata("pypdfium2") +
copy_metadata("scikit-learn") +
copy_metadata("shapely") +
copy_metadata("tokenizers") +
copy_metadata("einops") +
copy_metadata("jinja2") +
copy_metadata("regex") +
copy_metadata("tiktoken") +
[('D:\Project\Python\PythonProject\model', 'model'),('D:\Project\Python\PythonProject\assets', 'assets')]
)
hiddenimports = ['scipy._cyutility']
a = Analysis(
['end.py'],
pathex=[BASE_DIR],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
cipher=block_cipher,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='paddleocr',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='OCR'
)`
Beta Was this translation helpful? Give feedback.
All reactions