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