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.
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.
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.
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?
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?
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!!
Hi
I am currently working on water yield model ans I have this error: ValueError: could not convert string to float
please help me to solve it
Thank you
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.
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.
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.
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: PicklingError: Can’t pickle <function at 0x1BAC1E30>: it’s not found as pygeoprocessing.geoprocessing.
Which is not helpful at all, but if I look further up in the log messages, there’s this: ERROR aggregate vector C:/Temp/forums/Adele_AWY/Data_Adele/Data/subwatershade.shp does not intersect with the raster (u’C:\Temp\forums\Adele_AWY\output\intermediate\precip.tif’, 1)
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?
@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.