fix(ai): surface actionable fix for libGL.so.1 missing on headless installs

Proxmox LXC and other headless Linux installs lack libgl1, causing
all AI tools to show a misleading "install opencv-python-headless"
error even though the pip package is already installed. Detect the
libGL ImportError and suggest `apt-get install -y libgl1` instead.
This commit is contained in:
SnapOtter
2026-06-10 18:59:30 +08:00
parent 03600de4ef
commit 7c70c60b9e
6 changed files with 20 additions and 8 deletions
+3 -1
View File
@@ -16,7 +16,9 @@ try:
import cv2
from PIL import Image
except ImportError as _e:
print(json.dumps({"error": f"Missing dependency: {_e}. Install opencv-python-headless, numpy, and Pillow."}))
_msg = str(_e)
_hint = "Fix with: apt-get install -y libgl1" if "libGL" in _msg else "Install opencv-python-headless, numpy, and Pillow."
print(json.dumps({"error": f"Missing dependency: {_msg}. {_hint}"}))
sys.exit(1)