Error (taskgraph, OSError) in Batch Processing on Windows 10

I would like to generate a batch processing analysis using python file in SDR model. I follow the instructions that specified here, and accordingly did the following steps:

1- run the SDR latest version 3.10.1 and save output python file.

2- create a virtual environment using anaconda prompt, and installing all required packages with their correct version as specified on the above link.

3- use visual studio to edit the python output file generated by SDR model, and add for threshold_flow_accumulation in range(500, 1001, 50): … in order to automate the process.

4- I use PowerShell (attached image) to run the py file, and everything goes fine except that at the end I got errors related to taskgraph and OSError (I attached the log file of PowerShell).

Could you please help me understand where I made mistakes? (My knowledge regarding python is very limited)

Thanks in advance,

errorLog.txt (27.5 KB)

1 Like

Hi @alirez.t , thanks for posting your issue here.

It sounds like you did everything right, but maybe there is a problem with the conda environment, or possibly a problem with the geometry of one of the watershed polygons.

Could you share the output of a conda list command in your virtual environment? In particular I’m interested in the shapely version you have installed. It should be >=1.7.1 and <2.0.0.

If it’s not an issue with shapely & the python environment, you might need to share your script and the input data as well.

Best,

1 Like

Thanks @dave

I’ve checked the version of all dependencies to be correct, and attached the list here. Also, I attach my input files via Google Drive.

My purpose is to run a model with different Calibration Parameters in an iterative process (for instance for 50 times) and then investigate the result with some statistical methods.

Thanks for sharing this info, @alirez.t . I was able to run the model with your data, so this doesn’t seem like a data problem. Which means it still could be an environment problem. Here’s a few ideas:

conda list will give some more details than pip list, and that might be useful.

Also, in your invest installation, there’s a file that describes the python environment shipped with invest. For me it is:
C:\Program Files\InVEST_3.10.1_x64\invest-3-x64\package_versions.txt
(The path for you might be different if you installed invest only for your specific user; I installed for all users on my machine)

At the top of that file are instructions for a conda command that will create a python env exactly as specified by the file. So, assuming you can successfully run SDR from the user interface, you should also be able to run it in an environment created from this file.