修复 OCR libGL.so.1 缺失:安装 libgl1 等系统依赖。
- 新增 deploy/install-ocr-deps.sh,update.sh 自动检查 - install.sh 预装 OpenGL/Mesa 库
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user