From 0fab6f4de858cb8d0c0fbb0cfaee3e5d8f18cd0d Mon Sep 17 00:00:00 2001 From: butubb <1422726308@qq.com> Date: Wed, 19 Aug 2026 16:23:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20opencv-python-headless=20=E9=94=81=204.x?= =?UTF-8?q?=E2=80=94=E2=80=94=E6=B8=85=E5=8D=8E=E6=BA=90=205.0.0.93=20whee?= =?UTF-8?q?l=20=E6=89=93=E5=8C=85=E5=BC=82=E5=B8=B8=EF=BC=88site-packages?= =?UTF-8?q?=20=E6=97=A0=20cv2=20=E6=A8=A1=E5=9D=97=EF=BC=89=EF=BC=8COCR=20?= =?UTF-8?q?=E4=BB=8D=E4=B8=8D=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 2 +- scripts/start.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index eba76bd..8d71d1d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -32,7 +32,7 @@ uiautodev>=0.14 # 中英文模型随包内置;服务器/容器环境必须用 headless 版 opencv—— # opencv-python 依赖 X11 库(libxcb),slim 容器里 import cv2 直接崩,OCR 步骤任务失败退出) rapidocr_onnxruntime>=1.4 -opencv-python-headless>=4.8 +opencv-python-headless>=4.8,<5 # 锁定 4.x:5.x wheel 打包异常(无 cv2 模块) # APK 元信息解析(应用管理功能:自动读取包名/版本/应用名) pyaxmlparser>=0.3.27 diff --git a/scripts/start.sh b/scripts/start.sh index bd67009..0241e6c 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -14,6 +14,6 @@ fi # 环境修复:最后强制 headless(覆盖 rapidocr 拉回的 GUI 版) pip uninstall -y -q opencv-python 2>/dev/null || true -pip install -q -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python-headless +pip install -q -i https://pypi.tuna.tsinghua.edu.cn/simple "opencv-python-headless>=4.8,<5" # 5.x wheel 无 cv2 模块,锁定 4.x exec python -u web_server.py