# Error - Annual Water Yield InVEST 3.6.0

Hello,

I’m receiving an error during the run of an Annual Water Yield model. The main message is “Error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?”. What is this error about? I think that the information is well prepared, but it seems that the run is interrupted at the beginning.

Attached you can find the log file.

Thank you in advance for the help!

Hi @dierestrepo -

My guess is that the error is related to something in the biophysical table. Look at it in a text editor (not Excel) and make sure that the fields are separated by commas (not semicolons), that there are no blank lines at the end of the file, and that all of the data in the fields looks ok. It might be that you have a newline in one of the fields (maybe an LULC description field), which you can see by having the editor show newline/tab/etc characters.

~ Stacie

Hi Stacie,

Thank you for your quick response. I used a text editor and fixed the blank lines at the end of the file, I also found some other small mistakes that could be part of the problem, but it didn’t work, I still receive the same error.

Attached you can find the biophysical table, I think it is ok, maybe the problem is something else.

Thank you again!

biophysical_table.csv (2.3 KB)

Hi @dierestrepo, it looks like the ‘description’ field is missing quotation marks around the text in each row, leading to a parsing error. Could you try the attached table and make sure it works for you?

Thanks,
James

biophysical_table.csv (2.4 KB)

Hi James,

I tried again using your table but it didn’t work. Attached you can find the log file.

I’m starting to think that maybe the problem is not related to the biophysical table. Do you have any other idea?

Thank you very much for your help!!

Diego

Hi Diego,

The error in this latest logfile is a different one than the table-related one up above. We’ve recently made some updates to the Seasonal Water Yield model that haven’t been released yet, and it’s very possible that we might have already fixed this. Could you try this development build and let us know if you’re still getting this error?

Thanks,
James

Hi James,

I’m sorry I made a mistake, I sent you the log file of a Seasonal Water Yield model instead of the Annual Water Yield model, that was the one I was trying to fix the problem. I tried again with the biophysical table you sent to me and it worked! so the problem was related to that.

And the error related to the other log file (the mistaken one) was fixed with the other version of InVEST that you sent to me in the last message.

Thank you very much for your help, it was very useful!!

Diego

Hi
I am currently working on water yield model ans I have this error: ValueError: could not convert string to float
Thank you

depth_to_root_rest_layer_uri D:/PHD THESIS/ENV/Water Yield/1996/newwork/RootDepth1.tif
eto_uri D:/PHD THESIS/ENV/Water Yield/1996/newwork/ET.tif
lulc_uri D:/PHD THESIS/ENV/Water Yield/1996/newwork/Landuse1996.tif
pawc_uri D:/PHD THESIS/ENV/Water Yield/1996/newwork/water available.tif
precipitation_uri D:/PHD THESIS/ENV/Water Yield/1996/newwork/Rain1996.tif
results_suffix
seasonality_constant 3.86
sub_watersheds_uri D:/PHD THESIS/ENV/Water Yield/1996/newwork/Sub.shp
workspace_dir D:\PHD THESIS\ENV\Water Yield\1996\newwork

01/13/2020 04:47:48 osgeo ERROR [errno 4] D:/PHD THESIS/ENV/Water Yield/1996/newwork/biophysical_table.csv' not recognised as a supported file format. 01/13/2020 04:47:48 natcap.invest.hydropower.hydropower_water_yield INFO Starting Water Yield Core Calculations 01/13/2020 04:47:48 osgeo ERROR [errno 4] D:\PHD THESIS\ENV\Water Yield\1996\newwork’ not recognised as a supported file format.
01/13/2020 04:47:49 osgeo ERROR [errno 4] D:/PHD THESIS/ENV/Water Yield/1996/newwork/Sub.shp’ not recognised as a supported file format.
01/13/2020 04:47:55 natcap.invest.ui.model ERROR Exception while executing <function execute at 0x0B8241B0>
Traceback (most recent call last):
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\model.py”, line 1496, in _logged_target
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\hydropower\hydropower_water_yield.py”, line 139, in execute
ValueError: could not convert string to float:
01/13/2020 04:47:55 natcap.invest.ui.model INFO Execution finished
01/13/2020 04:47:55 natcap.invest.utils INFO Elapsed time: 6.54s
01/13/2020 04:47:55 natcap.invest.ui.execution ERROR Target <function _logged_target at 0x0B8248B0> failed with exception
Traceback (most recent call last):
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\model.py”, line 1496, in _logged_target
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\hydropower\hydropower_water_yield.py”, line 139, in execute
ValueError: could not convert string to float:
01/13/2020 04:47:55 natcap.invest.ui.execution INFO Execution finished

It looks like not all of the log file has been included, and it would be helpful to see the whole thing.

And actually, it would be helpful to post this question in a “New Topic”, since it is a different error. So if you would please start a New Topic, and post the entire log file (.txt) that the Water Yield model produces in your Workspace. This will help keep us more organized on the forum, and make it easier to find things later. Thanks!

Just a quick response to what I do see in the log output… These messages seem important:

01/13/2020 04:47:48 osgeo ERROR [errno 4] D:/PHD THESIS/ENV/Water Yield/1996/newwork/biophysical_table.csv’ not recognised as a supported file format

01/13/2020 04:47:48 osgeo ERROR [errno 4] D:\PHD THESIS\ENV\Water Yield\1996*newwork’ not recognised as a supported file format.*

01/13/2020 04:47:49 osgeo ERROR [errno 4] D:/PHD THESIS/ENV/Water Yield/1996/newwork/Sub.shp’ not recognised as a supported file format.

I’m not sure why it would be having problems with all of these inputs, especially since one’s a table, one’s a shapefile and one’s a workspace folder. Which makes me wonder if there is something about the path to the data folder that is causing problems.

• Are these data on a local hard drive, or a network drive? If they’re on a network drive, try moving them to a local drive.

• And/or could you try putting the model inputs in a folder where the path to that folder doesn’t have any spaces in it? For example, instead of “D:/PHD THESIS/…” try “D:/PHD_THESIS/…” and see if that helps.

~ Stacie

It’s interesting to note that GDAL is attempting to open all of these (the model shouldn’t be using GDAL for opening tables or directories), so there’s something else going on here.

@adele, it would be very helpful to see your whole error log if this is still an issue.

Thanks!

my model was processing to 100% but every time after of 100% I have an errorr
InVEST-Hydropower-Water-Yield-log-2020-01-14–05_06_28.txt (64.6 KB)

could you please see the file, after 100% I have this error,
InVEST-Hydropower-Water-Yield-log-2020-01-14–05_06_28.txt (64.6 KB)

It looks like the model is still running. Depending on how large your area is and/or the resolution of your input data (particularly the land cover map for Annual Water Yield), the model can take a while to run.

Those errors are curious though. If you look at the whole log file you’ll see that this error occurs multiple times, yet the model keeps running. It will be interesting to see what the results look like.

~ Stacie

Hi @swolny
Yes it’s running but after 2 hours it ends with the same error and no specific result is produced

@swolny
Hi
I ran my model 24 times a week but it gives the same error , I am really confused
can I send my data to you for check?

~ Stacie

@swolny

Thanks for sending your data. I see that you’re using InVEST 3.4, but I am testing it on version 3.7 since that has a lot of improvements and bug fixes, and we generally recommend using the latest version.

When I run Annual Water Yield with the data you sent, I get this message:

Which is not helpful at all, but if I look further up in the log messages, there’s this:

This indicates that subwatershade.shp has a different coordinate system than your other spatial layers. Looking at the layer properties in a GIS, subwatershade.shp has a geographic coordinate system of “GCS_WGS_1984”, but the other spatial layers are in the projected coordinate system of “WGS_1984_UTM_Zone_40N”.

This model requires that all spatial layers be in the same projected coordinate system. When I reprojected subwatershade.shp to WGS_1984_UTM_Zone_40N, the model ran successfully and very quickly.

One thing of note with the results is that the water yield values are very small. The rainfall values are very low, while the ET values are much higher. I guess this is a very dry/desert type of ecosystem?

~ Stacie

1 Like

@swolny
I really appreciate your help. Thank you . I install new version and re projected sub-watershade, then the model ran successfully .
the area study is arid region type of ecosystem, but after ran I knew I made a mistake in ET0 values and I edited it.
Thank you so much.