QSWATMOD error

7 views
Skip to first unread message

al wang

unread,
Jan 20, 2026, 12:17:51 PM (14 days ago) Jan 20
to SWAT-MODFLOW
Hello everyone, I am currently using the latest QSWATMOD to create RT3D. However, when creating RT3D, an error occurred. There is already an ICBUND. Here is the specific error message. Could you please tell me how to solve it?


raceback (most recent call last):
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\arrays\integer.py", line 51, in _safe_cast
              return values.astype(dtype, casting="safe", copy=copy)
             TypeError: Cannot cast array data from dtype('O') to dtype('int64') according to the rule 'safe'
             
             During handling of the above exception, another exception occurred:
             
             Traceback (most recent call last):
              File "C:\Users/lenovo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\dialogs\create_rt3d_dlg.py", line 124, in test
              write_rt3d.write_rt3d_inputs(self)
              File "C:\Users/lenovo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\pyfolder\write_rt3d.py", line 641, in write_rt3d_inputs
              icb_df = create_icbund_array(self)
              File "C:\Users/lenovo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\pyfolder\write_rt3d.py", line 150, in create_icbund_array
              icb_df_ = pd.DataFrame(np.reshape(icb, (nrows, ncols)), dtype="Int64")
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\frame.py", line 722, in __init__
              mgr = ndarray_to_mgr(
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\internals\construction.py", line 316, in ndarray_to_mgr
              return arrays_to_mgr(values, columns, index, dtype=dtype, typ=typ)
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\internals\construction.py", line 123, in arrays_to_mgr
              arrays = _homogenize(arrays, index, dtype)
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\internals\construction.py", line 617, in _homogenize
              val = sanitize_array(
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\construction.py", line 597, in sanitize_array
              subarr = _try_cast(data, dtype, copy, raise_cast_failure)
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\construction.py", line 804, in _try_cast
              subarr = array_type(arr, dtype=dtype, copy=copy)
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\arrays\masked.py", line 132, in _from_sequence
              values, mask = cls._coerce_to_array(scalars, dtype=dtype, copy=copy)
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\arrays\numeric.py", line 258, in _coerce_to_array
              values, mask, _, _ = _coerce_to_data_and_mask(
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\arrays\numeric.py", line 214, in _coerce_to_data_and_mask
              values = dtype_cls._safe_cast(values, dtype, copy=False)
              File "C:\PROGRA~1\QGIS32~1.12\apps\Python39\lib\site-packages\pandas\core\arrays\integer.py", line 53, in _safe_cast
              casted = values.astype(dtype, copy=copy)
             TypeError: int() argument must be a string, a bytes-like object or a number, not 'QVariant'
1f6d9be106830e25dbf6ec5e8680ec07.png
             

Reply all
Reply to author
Forward
0 new messages