gustavowillam / SmartMapPlugin

Plugin Qgis3.10.x para interpolação utilizando Krigagem Ordinária (OK), Machine Learning (ML) e Geração de Zonas de Manejo
https://github.com/gustavowillam/SmartMapPlugin
GNU General Public License v3.0
53 stars 14 forks source link

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

Open Kahnthegoodone opened 1 week ago

Kahnthegoodone commented 1 week ago

Hello, I have been trying to use Smart-Map (version 1.4.2) in conjunction with QGIS version 3.34, however when I check the box to load the plugin, I get this error: "_Couldn't load plugin 'SmartMap' due to an error when calling its classFactory() method"

I have looked through the closed issues and see that most people experiencing this issue have the wrong versions of GIS or Smart-Map installed. However as far as I am able to discern, I have the correct versions and am still experiencing issues. If there is any other supporting information needed in order to resolve this issue, please let me know.

See error log readout below:

PermissionError: [Errno 13] Permission denied: 'C:\Users\cgoodwin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages\sklearn\.libs\vcomp140.dll' Traceback (most recent call last): File "C:\Users\cgoodwin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages\sklearn__check_build__init.py", line 44, in from ._check_build import check_build # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1/QGIS33~1.12/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'sklearn.check_build._check_build'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users/cgoodwin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Smart_Map\utils\install_deps.py", line 284, in import sklearn File "C:\PROGRA~1/QGIS33~1.12/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\cgoodwin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages\sklearn__init.py", line 81, in from . import check_build # noqa: F401 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1/QGIS33~1.12/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\cgoodwin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages\sklearn__check_build__init.py", line 46, in raise_build_error(e) File "C:\Users\cgoodwin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages\sklearn__check_build\init.py", line 31, in raise_build_error raise ImportError("""%s ImportError: No module named 'sklearn.check_build._check_build'


Contents of C:\Users\cgoodwin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages\sklearn__check_build: setup.py _check_build.cp39-win_amd64.pydinit.py pycache


It seems that scikit-learn has not been built correctly.

If you have installed scikit-learn from source, please do not forget to build the package before using it: run python setup.py install or make in the source directory.

If you have used an installer, please check that it is suited for your Python version, your operating system and your platform.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\PROGRA~1/QGIS33~1.12/apps/qgis-ltr/./python\qgis\utils.py", line 423, in _startPlugin plugins[packageName] = package.classFactory(iface) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/cgoodwin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Smart_Map__init__.py", line 36, in classFactory from .Smart_Map import smart_map File "C:\PROGRA~1/QGIS33~1.12/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/cgoodwin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Smart_Map\Smart_Map.py", line 88, in from .utils import install_deps #Install deps on QGIS: sklearn, skfuzzy, pysal ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1/QGIS33~1.12/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/cgoodwin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Smart_Map\utils\install_deps.py", line 317, in load_external_package(qgis_python_version, 'sklearn', dep, exec_number, unzip=True) File "C:\Users/cgoodwin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Smart_Map\utils\install_deps.py", line 186, in load_external_package unzip_external_package(qgis_python_version, library_name, path_to_zip_file, directory_to_extract_to) File "C:\Users/cgoodwin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Smart_Map\utils\install_deps.py", line 147, in unzip_external_package zip_ref.extractall(directory_to_extract_to) File "C:\PROGRA~1\QGIS33~1.12\apps\Python312\Lib\zipfile__init.py", line 1744, in extractall self._extract_member(zipinfo, path, pwd) File "C:\PROGRA~1\QGIS33~1.12\apps\Python312\Lib\zipfile\init__.py", line 1801, in _extract_member open(targetpath, "wb") as target: ^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: 'C:\Users\cgoodwin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages\sklearn\.libs\vcomp140.dll'

Python version: 3.12.7 (main, Oct 25 2024, 11:18:09) [MSC v.1938 64 bit (AMD64)] QGIS version: 3.34.12-Prizren Prizren, eeb6af3638

gustavowillam commented 4 days ago

Hello,

The problem may be related to access permission, when the following error appears:

PermissionError: [Errno 13] Permission denied: 'C:\Users\cgoodwin\AppData\Roaming\QGIS\QGIS3\profiles\default \python\site-packages\sklearn.libs\vcomp140.dll'

It would be advisable to perform the manual installation using the .zip file. Download the .zip file from the QGIS website: https://plugins.qgis.org/plugins/Smart_Map/version/1.4.2/

Unzip the .zip file

Inside the unzipped folder you will find a zipped file with the name: sklearn312.zip

Unzip this folder. Inside the unzipped folder you will find the following folder and file structure:

image

Copy all these folders and files to the following folder on your computer: C:\Users\cgoodwin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages\

Before copying, delete all existing files in this folder.

Perform this entire process with QGIS closed.

After deleting the files and copying the unzipped files, open QGIS and check if the plugin is working.

I believe it will work.

Regards,