Skip to content

Deepness 0.6.5 fails on QGIS 3.44.9 / Python 3.12 due to OpenCV and NumPy incompatibility #235

Description

@goldhahnpatrick90-boop
Image Image Image Image Image Image Image Image Image

Windows 11 Pro 24H2
QGIS 3.44.9 (LTR)
Python 3.12.13 (bundled with QGIS)
NumPy 2.4.3 (bundled with QGIS)
Deepness 0.6.5
Also reproduced on QGIS 3.30.2

Problem

Deepness installation completes, but the plugin cannot initialize correctly because OpenCV (cv2) fails to load.

Investigation performed

Tested with a completely fresh QGIS profile.
Same problem reproduced on both QGIS 3.44.9 and QGIS 3.30.2.

Verified that Deepness installs its dependencies into:

%APPDATA%\QGIS\QGIS3\profiles\python\plugins\deepness\python3.12

The requirements.txt shipped with Deepness contains:

numpy<2.0.0
opencv-python-headless<=4.9.0.80
onnxruntime-gpu<=1.17.0

QGIS 3.44.9 ships with NumPy 2.4.3.

Observed errors

Initial cv2 import error:

ImportError:
ERROR: recursion is detected during loading of "cv2" binary extensions.
Check OpenCV installation.

Additional findings

The newly installed cv2 directory appeared incomplete and was missing:

config.py
config-3.py

An older backup copy of the cv2 directory contained these files.

After replacing the newly installed cv2 directory with the older complete version, the recursion error disappeared and a different error appeared:

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.4.3

ImportError:
numpy.core.multiarray failed to import

QGIS Python environment

Python version:
3.12.13

NumPy version:
2.4.3

NumPy location:
C:\Program Files\QGIS 3.44.9\apps\Python312\Lib\site-packages\numpy

Conclusion

The issue appears to be related to dependency compatibility:

Deepness requirements explicitly require numpy<2.0.0.
QGIS 3.44.9 provides NumPy 2.4.3.
The installed OpenCV build appears to have been compiled against NumPy 1.x and cannot load with NumPy 2.x.
Additionally, the installed cv2 package may be incomplete because required configuration files were missing after installation.

Expected behaviour

Deepness should either:

install a dependency set compatible with QGIS Python 3.12 + NumPy 2.x, or
isolate its own dependency environment so that NumPy/OpenCV version conflicts do not occur.

Please let me know if additional logs or dependency listings are needed.

Die Plugin-Version 0.6.5 ist offiziell für QGIS bis 3.99 freigegeben.

In deiner lokalen requirements.txt steht jedoch ausdrücklich:

numpy<2.0.0
opencv-python-headless<=4.9.0.80

während QGIS 3.44 bereits NumPy 2.4.3 mitliefert. Das ist der stärkste technische Hinweis auf die Ursache des Problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions