# Keyerror in Habitat Quality

**URL:** <https://community.naturalcapitalalliance.org/t/keyerror-in-habitat-quality/165>\
**Category:** Software Support\
**Tags:** habitat-quality\
**Created:** [May 26, 2019, 1:18am UTC](https://community.naturalcapitalalliance.org/t/keyerror-in-habitat-quality/165 "2019-05-26T01:18:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![heyaya](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@heyaya](https://community.naturalcapitalalliance.org/u/heyaya)\
**Post date:** [May 26, 2019, 1:18am UTC](https://community.naturalcapitalalliance.org/t/keyerror-in-habitat-quality/165/1 "2019-05-26T01:18:16Z")

</div>

Hello,

I am receiving an error on my habitat quality model. There is a keyerror in the process of model running. The error is” exception found while running natcap. invest. habitat\_quality”. I do not know the specific issues so that I do not know how to deal with it.

I have attached my log file and the screenshot of the error as well.

Thank you for the attempt.  
[natcap.invest.habitat\_quality-log-2019-05-25–15\_19\_01.txt](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/1X/f9fe6b43f60bc135eb0eebec8337da545d9122d5.txt) (4.9 KB)

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/1X/f1a06d76637bcd2aef6150087d431fe0b20f2466.png)

---

<div class="post-metadata">

**Author:** ![swolny](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/swolny/32/181_2.png) [@swolny](https://community.naturalcapitalalliance.org/u/swolny)\
**Post date:** [May 28, 2019, 2:06pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-in-habitat-quality/165/2 "2019-05-28T14:06:21Z")

</div>

Hi @heyaya

Thank you for posting the log file. Assuming that there is a “HABITAT” field in your sensitivity table (which is required), check the format of your sensitivity.csv file. Look at it in a text editor and see if the values are separated by commas (not semicolons or any other character), and if there is a blank line at the bottom of the file, delete it. See if either of those things helps.

~ Stacie

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [May 28, 2019, 5:10pm UTC](https://community.naturalcapitalalliance.org/t/keyerror-in-habitat-quality/165/3 "2019-05-28T17:10:25Z")

</div>

Just to add here @heyaya, it looks like you’re using a really old version of InVEST (version 3.3.3). I’d strongly suggest upgrading to the latest InVEST 3.7.0 to take advantage of the latest fixes to this model. InVEST can be downloaded here: [http://naturalcapitalproject.stanford.edu/invest](http://naturalcapitalproject.stanford.edu/invest)
