修复 OCR libGL.so.1 缺失:安装 libgl1 等系统依赖。

- 新增 deploy/install-ocr-deps.sh,update.sh 自动检查

- install.sh 预装 OpenGL/Mesa 库
This commit is contained in:
dekun
2026-06-28 13:57:49 +08:00
parent a145f38606
commit 1c50ebc0ec
7 changed files with 67 additions and 3 deletions
+4 -1
View File
@@ -113,7 +113,10 @@ def _process_wrong_question(question_id: uuid.UUID):
db.commit()
except Exception as exc:
wq.status = WrongQuestionStatus.failed
wq.error_message = _short_error(exc, "OCR 识别失败:")
msg = _short_error(exc, "OCR 识别失败:")
if "libGL" in str(exc):
msg += " 请在服务器执行: sudo bash deploy/install-ocr-deps.sh && systemctl restart grade-archive"
wq.error_message = msg
db.commit()
return
+5
View File
@@ -1,9 +1,14 @@
from pathlib import Path
import os
from PIL import Image
from app.core.config import settings
# 无图形界面服务器:避免 OpenCV/Paddle 依赖 X11
os.environ.setdefault("OPENCV_IO_ENABLE_OPENEXR", "0")
_ocr_engine = None