Dear Chris George
I've encountered this error when I chose to run the option "use GWflow" in the second step (creating HRU) using the new version of QSWAT+ (2.5.3).
ImportError: The 'read_file' function requires the 'pyogrio' or 'fiona' package, but neither is installed or imports correctly. Importing fiona resulted in: DLL load failed while importing _env: The specified module could not be found. Importing pyogrio resulted in: No module named 'pyogrio'
Traceback (most recent call last):
File "C:\Users/Khaled/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_12\QSWATPlus\hrus.py", line 5713, in calcHRUs
gwf.run()
File "C:\Users/Khaled/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_12\QSWATPlus\gwflow.py", line 447, in run
basin_gdf, grid1_gdf, rows, cols = self.fishnet(basin_file, self.cell_size, os.path.join(self.grids, 'grid1.shp'), EPSG)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/Khaled/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_12\QSWATPlus\gwflow.py", line 1059, in fishnet
gdf = gpd.read_file(basinFileName)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\geopandas\io\file.py", line 263, in _read_file
engine = _check_engine(engine, "'read_file' function")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\geopandas\io\file.py", line 122, in _check_engine
raise ImportError(
ImportError: The 'read_file' function requires the 'pyogrio' or 'fiona' package, but neither is installed or imports correctly.
Importing fiona resulted in: DLL load failed while importing _env: The specified module could not be found.
Importing pyogrio resulted in: No module named 'pyogrio'
Python version: 3.12.3 (main, Apr 14 2024, 17:21:43) [MSC v.1938 64 bit (AMD64)] QGIS version: 3.36.3-Maidenhead Maidenhead, 2df96554
Python Path:
C:/PROGRA~1/QGIS33~1.3/apps/qgis/./python
C:/Users/Khaled/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/Khaled/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS33~1.3/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS33~1.3\apps\grass\grass83\etc\python
C:\Users\Khaled\Documents
C:\Program Files\QGIS 3.36.3\bin\python312.zip
C:\PROGRA~1\QGIS33~1.3\apps\Python312\DLLs
C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib
C:\Program Files\QGIS 3.36.3\bin
C:\PROGRA~1\QGIS33~1.3\apps\Python312
C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages
C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\win32
C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\win32\lib
C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\Pythonwin
C:/Users/Khaled/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\Khaled\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\HCMGIS/forms
C:\Users\Khaled\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
C:\Users/Khaled/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_12\QSWATPlus
-----------------------------------------------------------------------------------------------------
I have successfully installed the
pyogrio and fiona using the pip install commend and tried to set the environment variables in the path correctly, but unfortunately, the error still exists. Any tips to overcome this problem ?!
Thanks in advance.
Khaled