# Problem installing natcap.invest Python package

**URL:** <https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618>\
**Category:** Software Support\
**Tags:** annual-water-yield, python\
**Created:** [April 5, 2024, 9:55am UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618 "2024-04-05T09:55:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sachin](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@sachin](https://community.naturalcapitalalliance.org/u/sachin)\
**Post date:** [April 5, 2024, 9:55am UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618/1 "2024-04-05T09:55:53Z")

</div>

#### I have been trying to run the InVEST “Annual Water Yield” model from Python (Google Colab) as part of the sensitivity analysis and calibration of the model. The error as attached pops up. The code used was generated from the InVEST software itself.

Unable to run the python code for “Annual Water Yield” from Google Colab

#### “could not find a version that satisfies the requirement natcap” message pops up

 ![Error 1](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/b/b5ac389207e8827e44210d2bf66cb955767b12a0.png)

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [April 5, 2024, 1:27pm UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618/2 "2024-04-05T13:27:49Z")

</div>

Hi @sachin , thanks for posting. The name of the package you’ll need to install is actually `natcap.invest`, rather than just `natcap`.

And we recommend installing it from conda-forge, rather than using pip, because of challenges with compiling GDAL binaries. All the details are here: [Installing the InVEST Python Package — InVEST 3.14.1.post148+g59145ca.d20240403 documentation](https://invest.readthedocs.io/en/latest/installing.html)

Please let us know if that works for you!

---

<div class="post-metadata">

**Author:** ![Monika](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@Monika](https://community.naturalcapitalalliance.org/u/Monika)\
**Post date:** [April 6, 2024, 9:47am UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618/3 "2024-04-06T09:47:59Z")

</div>

I would like to know what version of python needs to be configured to be compatible if the files provided by the API can be used normally. If I use 3.9 and 3.11, it is not fully compatible

---

<div class="post-metadata">

**Author:** ![sachin](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@sachin](https://community.naturalcapitalalliance.org/u/sachin)\
**Post date:** [April 8, 2024, 4:36am UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618/4 "2024-04-08T04:36:30Z")

</div>

Thank you for the reply. I will try the edits and keep you posted

---

<div class="post-metadata">

**Author:** ![sachin](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@sachin](https://community.naturalcapitalalliance.org/u/sachin)\
**Post date:** [April 8, 2024, 5:36am UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618/5 "2024-04-08T05:36:58Z")

</div>

I have tried “conda-forge” and the following error occurs. I checked my system for Python 3.12 and the version 3.12.2 is already installed.

 ![Error2](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/8/8ae94b197939ea6ab91cfa6dec9b883e9efbbf4a.png)

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [April 8, 2024, 5:39pm UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618/6 "2024-04-08T17:39:58Z")

</div>

`natcap.invest` is not currently available for Python 3.12. The final green message in your console indicates that the latest version of `natcap.invest (3.14.1) requires Python _less than_ 3.12. In other words, Python 3.11.x will work.

I recommend creating a new virtual environment with conda and specify python=3.11. Then install `natcap.invest`.

For example,

```auto
conda create -n env-invest "python=3.11"
conda activate env-invest
conda install natcap.invest -c conda-forge

```

---

<div class="post-metadata">

**Author:** ![sachin](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@sachin](https://community.naturalcapitalalliance.org/u/sachin)\
**Post date:** [April 9, 2024, 4:53am UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618/7 "2024-04-09T04:53:20Z")

</div>

Thank you for the update

---

<div class="post-metadata">

**Author:** ![sachin](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@sachin](https://community.naturalcapitalalliance.org/u/sachin)\
**Post date:** [April 15, 2024, 8:59am UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618/8 "2024-04-15T08:59:34Z")

</div>

Thank you for the support.  
The InVEST code (natcap.invest) works fine in Anaconda Prompt python 3.11

---

<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:** [April 22, 2024, 9:00am UTC](https://community.naturalcapitalalliance.org/t/problem-installing-natcap-invest-python-package/4618/9 "2024-04-22T09:00:26Z")

</div>

Closed on April 22, 2024, 9:00am UTC

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