NRCan / CanFlood

Flood Risk modelling toolbox for Canada
MIT License
29 stars 7 forks source link

vFunc Library: ImportError: Pandas requires version '2.0.1' or newer of 'xlrd' #95

Open cefect opened 9 months ago

cefect commented 9 months ago

When selecting the Function Set .xlsx an error is thrown. Seems to be a dependency issue for at least my QGIS 3.28.10 which has migrated to Pandas 2.0.1. As a quick workaround, users can manually upgrade their xlrd by: 1) opening a command prompt and activating the environment for the relevant QGIS build (usually by launching the batch file here c:\OSGeo4W\bin\o4w_env.bat, location may vary depending on how you installed) 2) using pip to upgrade: python -m pip xlrd --upgrade

This issue should be resolved when we migrate to the latest QGIS (although we will probably run into other challenges with Pandas 2.0).

ImportError: Pandas requires version '2.0.1' or newer of 'xlrd' (version '1.2.0' currently installed). Traceback (most recent call last): File "C:\Users\cef\AppData\Local\QGIS\QGIS3\profiles\dev\python\plugins\canflood\build\dialog_vfunc.py", line 342, in dislpayCsDetails data = self._load_cs(filePath) File "C:\Users\cef\AppData\Local\QGIS\QGIS3\profiles\dev\python\plugins\canflood\build\dialog_vfunc.py", line 544, in _load_cs clib_d_raw = pd.read_excel(fp, sheet_name=None, header=None, index_col=0) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\io\excel_base.py", line 478, in read_excel io = ExcelFile(io, storage_options=storage_options, engine=engine) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\io\excel_base.py", line 1513, in init self._reader = self._engines[engine](self._io, storage_options=storage_options) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\io\excel_xlrd.py", line 34, in init import_optional_dependency("xlrd", extra=err_msg) File "C:\OSGeo4W\apps\Python39\lib\site-packages\pandas\compat_optional.py", line 171, in import_optional_dependency raise ImportError(msg) ImportError: Pandas requires version '2.0.1' or newer of 'xlrd' (version '1.2.0' currently installed).

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.10-Firenze Firenze, e2edb9c468