semiautomaticgit/SemiAutomaticClassificationPlugin

Couldn't load plugin 'SemiAutomaticClassificationPlugin' due to an error when calling its classFactory() method

mirrorbbo opened this issue · 6 comments

Couldn't load plugin 'SemiAutomaticClassificationPlugin' due to an error when calling its classFactory() method

ModuleNotFoundError: No module named 'packaging'
Traceback (most recent call last):
File "C:/PROGRA1/QGIS31.10/apps/qgis-ltr/./python\qgis\utils.py", line 334, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:/Users/[NAME]/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin_init
.py", line 63, in classFactory
from .semiautomaticclassificationplugin import (
File "C:/PROGRA1/QGIS31.10/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/[NAME]/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\semiautomaticclassificationplugin.py", line 46, in
from .core import config as cfg, util_qgis, util_qt, utils, util_gdal, messages
File "C:/PROGRA1/QGIS31.10/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/[NAME]/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 33, in
from packaging.version import parse
File "C:/PROGRA1/QGIS31.10/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'packaging'

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS version: 3.10.14-A Coruña A Coruña, 8374282d2a

Python Path:
C:/PROGRA1/QGIS31.10/apps/qgis-ltr/./python
C:/Users/[NAME]/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/[NAME]/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA1/QGIS31.10/apps/qgis-ltr/./python/plugins
C:\PROGRA1\QGIS31.10\apps\Python37
C:\PROGRA1\QGIS31.10\apps\Python37\Scripts
C:\Program Files\QGIS 3.10\bin\python37.zip
C:\PROGRA1\QGIS31.10\apps\Python37\DLLs
C:\PROGRA1\QGIS31.10\apps\Python37\lib
C:\Program Files\QGIS 3.10\bin
C:\PROGRA1\QGIS31.10\apps\Python37\lib\site-packages
C:\PROGRA1\QGIS31.10\apps\Python37\lib\site-packages\win32
C:\PROGRA1\QGIS31.10\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA1\QGIS31.10\apps\Python37\lib\site-packages\Pythonwin
C:/Users/[NAME]/AppData/Roaming/QGIS/QGIS3\profiles\default/python

The current version of the plugins needs the "packaging" Python module to be installed. It seems to me the issue is due to the fact that you are using an old version of QGIS: the QGIS 3.10 OSGeo4W installer on Windows didn't install the "packaging" Python module by default.
You need to use a more recent version of QGIS on Windows from OSGeo4W (whose installer installs the "packaging" Python module by default) or you need to install the "packaging" Python module in order for the plugin to run correctly.

The current version of the plugins needs the "packaging" Python module to be installed. It seems to me the issue is due to the fact that you are using an old version of QGIS: the QGIS 3.10 OSGeo4W installer on Windows didn't install the "packaging" Python module by default. You need to use a more recent version of QGIS on Windows from OSGeo4W (whose installer installs the "packaging" Python module by default) or you need to install the "packaging" Python module in order for the plugin to run correctly.

I already had the latest version of QGIS prior to this and the same problem occurred.

I already had the latest version of QGIS prior to this and the same problem occurred.

Then I think it may be usefull if you would post the whole error message generated by the latest version (which one exactly?) of QGIS.

I already had the latest version of QGIS prior to this and the same problem occurred.

Then I think it may be usefull if you would post the whole error message generated by the latest version (which one exactly?) of QGIS.

I installed it successfully now but the problem is it's not showing in the menu toolbar
image

I also tried executing this manual [https://semiautomaticclassificationmanual.readthedocs.io/en/latest/installation_win64.html] but now this error shows up:
image

I resolved it by resetting my whole PC and reinstalling everything from scratch. :/

I resolved it by resetting my whole PC and reinstalling everything from scratch. :/

Thank you for your feedback.
It is quite strange, but I'm glad that an installation from scratch solved the issue.