fix: opencv-python-headless 锁 4.x——清华源 5.0.0.93 wheel 打包异常(site-packages 无 cv2 模块),OCR 仍不可用

This commit is contained in:
2026-08-19 16:23:36 +08:00
parent 5de87465bc
commit 0fab6f4de8
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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