# Crop yield module error: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 71: invalid continuation byte

**URL:** <https://community.naturalcapitalalliance.org/t/crop-yield-module-error-unicodedecodeerror-utf-8-codec-can-t-decode-byte-0xd5-in-position-71-invalid-continuation-byte/3490>\
**Category:** Software Support\
**Tags:** crop-production\
**Created:** [March 7, 2023, 7:21am UTC](https://community.naturalcapitalalliance.org/t/crop-yield-module-error-unicodedecodeerror-utf-8-codec-can-t-decode-byte-0xd5-in-position-71-invalid-continuation-byte/3490 "2023-03-07T07:21:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![summon](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@summon](https://community.naturalcapitalalliance.org/u/summon)\
**Post date:** [March 7, 2023, 7:21am UTC](https://community.naturalcapitalalliance.org/t/crop-yield-module-error-unicodedecodeerror-utf-8-codec-can-t-decode-byte-0xd5-in-position-71-invalid-continuation-byte/3490/1 "2023-03-07T07:21:44Z")

</div>

Hello, my crop production module operation is always wrong, but can not find the problem, the wrong screenshot is as follows, everyone has any good opinion

03/07/2023 15:14:57 natcap.invest.utils Level 100 Writing log messages to [D:\lunwenziliao\xiaolunwen\����\2000bean\InVEST-natcap.invest.crop\_production\_percentile-log-2023-03-07–15\_14\_57.txt]  
03/07/2023 15:14:57 **main** Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.crop\_production\_percentile 3.12.1:  
aggregate\_polygon\_path  
landcover\_raster\_path D:\lunwenziliao\xiaolunwen\PLUSmodel\LUCC\2000lucc.tif  
landcover\_to\_crop\_table\_path C:\Users\13598\Desktop\landcover\_to\_crop\_table.csv  
model\_data\_path D:\InVEST\CropProduction\model\_data  
n\_workers -1  
results\_suffix 2000baen  
workspace\_dir D:\lunwenziliao\xiaolunwen\����\2000bean

03/07/2023 15:14:57 natcap.invest.crop\_production\_percentile INFO Processing crop rice  
03/07/2023 15:14:57 natcap.invest.crop\_production\_percentile INFO Clipping global climate bin raster to landcover bounding box.  
03/07/2023 15:14:57 natcap.invest.crop\_production\_percentile INFO Map yield\_25th to climate bins.  
03/07/2023 15:14:57 pygeoprocessing.geoprocessing INFO starting stats\_worker  
03/07/2023 15:14:57 pygeoprocessing.geoprocessing INFO started stats\_worker \<Thread(Thread-1 (stats\_worker), started daemon 10020)\>  
03/07/2023 15:14:57 pygeoprocessing.geoprocessing ERROR exception encountered in raster\_calculator  
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 71: invalid continuation byte

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “pygeoprocessing\geoprocessing.py”, line 415, in raster\_calculator  
File “osgeo\gdal.py”, line 3743, in ReadAsArray  
File “C:\Users\13598\AppData\Local\Temp\embedded.tzlylaiq.zip\shibokensupport\__feature_\_.py”, line 142, in \_import  
File “”, line 1027, in \_find\_and\_load  
File “”, line 1006, in \_find\_and\_load\_unlocked  
File “”, line 688, in \_load\_unlocked  
File “PyInstaller\loader\pyimod02\_importers.py”, line 499, in exec\_module  
File “osgeo\gdal\_array.py”, line 137, in   
SystemError: \_PyEval\_EvalFrameDefault returned a result with an exception set  
03/07/2023 15:14:57 pygeoprocessing.geoprocessing INFO Waiting for raster stats worker result.  
03/07/2023 15:14:57 pygeoprocessing.geoprocessing\_core WARNING No valid pixels were received, sending None.  
03/07/2023 15:14:57 taskgraph.Task ERROR Something went wrong when adding task create\_coarse\_yield\_percentile\_rice\_yield\_25th (1), terminating taskgraph.  
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 71: invalid continuation byte

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “taskgraph\Task.py”, line 674, in add\_task  
File “taskgraph\Task.py”, line 1093, in _call  
File “natcap\invest\utils.py”, line 955, in reclassify\_raster  
File “pygeoprocessing\geoprocessing.py”, line 1944, in reclassify\_raster  
File “pygeoprocessing\geoprocessing.py”, line 415, in raster\_calculator  
File “osgeo\gdal.py”, line 3743, in ReadAsArray  
File "C:\Users\13598\AppData\Local\Temp\embedded.tzlylaiq.zip\shibokensupport\_feature_.py", line 142, in \_import  
File “”, line 1027, in \_find\_and\_load  
File “”, line 1006, in \_find\_and\_load\_unlocked  
File “”, line 688, in \_load\_unlocked  
File “PyInstaller\loader\pyimod02\_importers.py”, line 499, in exec\_module  
File “osgeo\gdal\_array.py”, line 137, in   
SystemError: \_PyEval\_EvalFrameDefault returned a result with an exception set  
03/07/2023 15:14:57 natcap.invest.utils ERROR Exception while executing natcap.invest.crop\_production\_percentile  
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 71: invalid continuation byte

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: \<class ‘UnicodeDecodeError’\> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 72, in \_log\_gdal\_errors  
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 164, in prepare\_workspace  
File “invest\cli.py”, line 486, in main  
File “natcap\invest\crop\_production\_percentile.py”, line 430, in execute  
File “taskgraph\Task.py”, line 674, in add\_task  
File “taskgraph\Task.py”, line 1093, in _call  
File “natcap\invest\utils.py”, line 955, in reclassify\_raster  
File “pygeoprocessing\geoprocessing.py”, line 1944, in reclassify\_raster  
File “pygeoprocessing\geoprocessing.py”, line 415, in raster\_calculator  
File “osgeo\gdal.py”, line 3743, in ReadAsArray  
File "C:\Users\13598\AppData\Local\Temp\embedded.tzlylaiq.zip\shibokensupport\_feature_.py", line 142, in \_import  
File “”, line 1027, in \_find\_and\_load  
File “”, line 1006, in \_find\_and\_load\_unlocked  
File “”, line 688, in \_load\_unlocked  
File “PyInstaller\loader\pyimod02\_importers.py”, line 499, in exec\_module  
File “osgeo\gdal\_array.py”, line 137, in   
SystemError: \_PyEval\_EvalFrameDefault returned a result with an exception set  
03/07/2023 15:14:57 natcap.invest.utils INFO Elapsed time: 0.11s  
03/07/2023 15:14:57 natcap.invest.utils INFO Execution finished

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [March 7, 2023, 2:22pm UTC](https://community.naturalcapitalalliance.org/t/crop-yield-module-error-unicodedecodeerror-utf-8-codec-can-t-decode-byte-0xd5-in-position-71-invalid-continuation-byte/3490/2 "2023-03-07T14:22:52Z")

</div>

Hi @summon,

Thanks for posting and pasting your logfile. Could you also upload / attach your logfile? It’s easier for us to review it for errors with the actual file.

But, it looks like you might be having the same issue as this post: ['utf-8' codec can't decode byte 0xd5 in position 71 - #3 by jujeonghoo](https://community.naturalcapitalalliance.org/t/utf-8-codec-cant-decode-byte-0xd5-in-position-71/3486/3).

Could you try the steps outlined in that post?

Doug

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/8/8d95591aa074da87ea0fdd61ca47c1c3c0588aa7.png) [@system](https://community.naturalcapitalalliance.org/u/system)\
**Post date:** [June 5, 2023, 2:23pm UTC](https://community.naturalcapitalalliance.org/t/crop-yield-module-error-unicodedecodeerror-utf-8-codec-can-t-decode-byte-0xd5-in-position-71-invalid-continuation-byte/3490/3 "2023-06-05T14:23:20Z")

</div>

Closed on June 5, 2023, 2:23pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
