From 13af2b0f47565e5549d37a6d512757020aa7da63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Fri, 14 Mar 2025 16:40:20 +0100 Subject: [PATCH] Hacky fix to make OpenCV dll (cv2.*.pyd) load properly. Fails if imported after PIL. --- run.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/run.py b/run.py index ac9615ea..44d62aef 100755 --- a/run.py +++ b/run.py @@ -6,6 +6,9 @@ if sys.version_info.major < 3: print("Ups! ODM needs to run with Python 3. It seems you launched it with Python 2. Try using: python3 run.py ... ") sys.exit(1) +# Hack: early import cv2 because PIL init will break DLL loading. +import cv2 + import os from opendm import log from opendm import config