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
52 stars 13 forks source link

"Pandas library not found" #36

Closed mfaisalhanif closed 1 year ago

mfaisalhanif commented 1 year ago

I have recently upgraded Python and QGIS on my laptop and since then I cannot run the smart-map plugin. Whenever I try installing it, I get the following error message.

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

ImportError: cannot import name 'find_stack_level' from 'pandas.util._exceptions' (C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\util_exceptions.py) Traceback (most recent call last): File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 423, in _startPlugin plugins[packageName] = package.classFactory(iface) File "C:\Users/M Faisal/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Smart_Map__init.py", line 36, in classFactory from .Smart_Map import smart_map File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users/M Faisal/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Smart_Map\Smart_Map.py", line 91, in import pandas as pd File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pandas__init__.py", line 52, in from pandas.core.api import ( File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\core\api.py", line 14, in from pandas.core.algorithms import factorize, unique, value_counts File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\core\algorithms.py", line 58, in from pandas.core.indexers import validate_indices File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\core\indexers\init__.py", line 1, in from pandas.core.indexers.utils import ( File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\core\indexers\utils.py", line 18, in from pandas.util._exceptions import find_stack_level ImportError: cannot import name 'find_stack_level' from 'pandas.util._exceptions' (C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\util_exceptions.py)

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] QGIS version: 3.28.4-Firenze Firenze, fd0fb72ab3

Python Path: C:/OSGeo4W/apps/qgis-ltr/./python C:/Users/M Faisal/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/M Faisal/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/OSGeo4W/apps/qgis-ltr/./python/plugins C:\OSGeo4W\bin\python39.zip C:\OSGeo4W\apps\Python39\DLLs C:\OSGeo4W\apps\Python39\lib C:\OSGeo4W\bin C:\OSGeo4W\apps\Python39 C:\OSGeo4W\apps\Python39\lib\site-packages C:\OSGeo4W\apps\Python39\lib\site-packages\win32 C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin C:/Users/M Faisal/AppData/Roaming/QGIS/QGIS3\profiles\default/python

image

gustavowillam commented 1 year ago

Hello, There is some incompatibility with the python pandas library, in the version you are using.

Error: ImportError: cannot import name 'find_stack_level' from 'pandas.util._exceptions' (C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\util_exceptions.py)

Suggestion to fix: 1) update pandas library to latest version via command prompt: pip install pandas

2) Install a QGIS version older than 3.28 (QGIS 3.22 LTR suggestion: https://download.qgis.org/downloads/QGIS-OSGeo4W-3.22.16-1.msi)

3) Remove QGIS and reinstall version 3.28 (https://qgis.org/downloads/QGIS-OSGeo4W-3.28.4-3.msi) in a different folder other than: C:\OSGeo4W. Try to install in the folder: C:\Program Files\QGIS 3.28.4

mfaisalhanif commented 1 year ago

Thank you for your assistance. It turns out that the Pandas library on my system was already up to date. However, I was able to resolve the issue by installing an older version of QGIS (version 3.22).