semiautomaticgit / SemiAutomaticClassificationPlugin

https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html
Other
136 stars 50 forks source link

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

Closed mirrorbbo closed 8 months ago

mirrorbbo commented 8 months ago

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:/PROGRA~1/QGIS3~1.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:/PROGRA~1/QGIS3~1.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:/PROGRA~1/QGIS3~1.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:/PROGRA~1/QGIS3~1.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:/PROGRA~1/QGIS3~1.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:/PROGRA~1/QGIS3~1.10/apps/qgis-ltr/./python/plugins C:\PROGRA~1\QGIS3~1.10\apps\Python37 C:\PROGRA~1\QGIS3~1.10\apps\Python37\Scripts C:\Program Files\QGIS 3.10\bin\python37.zip C:\PROGRA~1\QGIS3~1.10\apps\Python37\DLLs C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib C:\Program Files\QGIS 3.10\bin C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\win32 C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\win32\lib C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\Pythonwin C:/Users/[NAME]/AppData/Roaming/QGIS/QGIS3\profiles\default/python

agiudiceandrea commented 8 months ago

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.

mirrorbbo commented 8 months ago

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.

agiudiceandrea commented 8 months ago

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.

mirrorbbo commented 8 months ago

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

mirrorbbo commented 8 months ago

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

semiautomaticgit commented 8 months ago

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.