PUTvision/qgis-plugin-deepness

problems of installing the deepness plugin stettings

Opened this issue · 6 comments

Hi, I wanted to install the deepness plugin to use it for determining the trees on our rasterfile.
I've followed these instructions on the paper:
https://mapscaping.com/deep-learning-image-segmentation-qgis/
and in step 6 I've got these errors:

Installation of required packages finished. Validating installation...
Python packages required by the plugin could not be loaded due to the following error:
Traceback (most recent call last):
File "C:\Users/veerle.ott/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\deepness\dialogs\packages_installer\packages_installer_dialog.py", line 300, in check_packages_installation_and_log
import_packages()
File "C:\Users/veerle.ott/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\deepness\dialogs\packages_installer\packages_installer_dialog.py", line 325, in import_packages
import_package(package)
File "C:\Users/veerle.ott/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\deepness\dialogs\packages_installer\packages_installer_dialog.py", line 320, in import_package
importlib.import_module(package.import_name)
File "C:\PROGRA1\QGIS321.6\apps\Python39\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'cv2'

What can I do?
thanks in advance

Hi @vott-coder!
First, check this issue.

If you are a more advanced user, check these steps:

Update the OpenCV (cv2) library in QGIS:

  1. Open the Python console in QGIS (Ctrl + Alt + P)
  2. Import the PIP library by typing import pip
  3. Then, update (or install) OpenCV by typing pip.main(['install', '--upgrade', 'opencv-python'])
  4. You should see the last message, such as Successfully installed opencv-python
  5. Restart QGIS

If the error still exists, you need to respond to the questions:
Desktop (please complete the following information):

  • OS: [e.g. Windows 10, Ubuntu 22.04]
  • QGiS version
  • Deepness version

In the future, we plan to record tutorials for Ubuntu and Windows systems on how to install Deepness, including the most often issues solved. Furthermore, we plan to manage some specific cases in the plugin background, but it is challenging to maintain compatibility for all OSes and QGIS, python, and library versions.

Hi @vott-coder! First, check this issue.

If you are a more advanced user, check these steps:

Update the OpenCV (cv2) library in QGIS:

  1. Open the Python console in QGIS (Ctrl + Alt + P)
  2. Import the PIP library by typing import pip
  3. Then, update (or install) OpenCV by typing pip.main(['install', '--upgrade', 'opencv-python'])
  4. You should see the last message, such as Successfully installed opencv-python
  5. Restart QGIS

If the error still exists, you need to respond to the questions: Desktop (please complete the following information):

  • OS: [e.g. Windows 10, Ubuntu 22.04]
  • QGiS version
  • Deepness version

In the future, we plan to record tutorials for Ubuntu and Windows systems on how to install Deepness, including the most often issues solved. Furthermore, we plan to manage some specific cases in the plugin background, but it is challenging to maintain compatibility for all OSes and QGIS, python, and library versions.

Hi, after re-installing still the same error but in the logbook for plug-ins:

2024-12-13T13:13:52 INFO Geladen GRASS 8 (Pad: C:/PROGRA1/QGIS331.13/apps/qgis-ltr/plugins/plugin_grass8.dll)
2024-12-13T13:13:58 INFO Geladen Deepness: Deep Neural Remote Sensing (package: deepness)
2024-12-13T13:13:59 INFO Geladen Freehand raster georeferencer (package: FreehandRasterGeoreferencer)
2024-12-13T13:14:05 INFO Geladen geopunt4Qgis (package: geopunt4Qgis)
2024-12-13T13:14:08 INFO Geladen QuickMapServices (package: quick_map_services)
2024-12-13T13:14:08 INFO Geladen RasterStats (package: rasterstats)
2024-12-13T13:14:08 INFO Geladen DB Manager (package: db_manager)
2024-12-13T13:14:10 INFO Geladen MetaSearch Catalog Client (package: MetaSearch)
2024-12-13T13:14:14 INFO Geladen Processing (package: processing)
2024-12-13T13:17:08 INFO Geladen Deepness: Deep Neural Remote Sensing (package: deepness)

Installation of required packages finished. Validating installation...
Python packages required by the plugin could not be loaded due to the following error:
Traceback (most recent call last):
File "C:\Users/veerle.ott/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\deepness\dialogs\packages_installer\packages_installer_dialog.py", line 300, in check_packages_installation_and_log
import_packages()
File "C:\Users/veerle.ott/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\deepness\dialogs\packages_installer\packages_installer_dialog.py", line 325, in import_packages
import_package(package)
File "C:\Users/veerle.ott/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\deepness\dialogs\packages_installer\packages_installer_dialog.py", line 320, in import_package
importlib.import_module(package.import_name)
File "C:\PROGRA1\QGIS331.13\apps\Python312\Lib\importlib_init
.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'cv2'

I've also tried this but didn't see the message (successfully installed...), but I am not an experienced user...
Update the OpenCV (cv2) library in QGIS:
Open the Python console in QGIS (Ctrl + Alt + P)
Import the PIP library by typing import pip
Then, update (or install) OpenCV by typing pip.main(['install', '--upgrade', 'opencv-python'])
You should see the last message, such as Successfully installed opencv-python
Restart QGIS

Windows 11 enterprise
QGIS 3.34.13
Deepness 0.6.5.

Hi, it seems Deepness cannot install the opencv python package (ModuleNotFoundError: No module named 'cv2'). Please try to install it manually, I think there were already some detailed instructions in the issues.
Let me know if you cannot find it.

Hello, Did you try what I describe in the #193 issue : #193 ?
NB : I did that from the command-line, not from the Python interpreter.
Maybe you could also update QGIS : it will update also all the Python environment.
Yours, AF