Unable to use the API - C++ missing

I am trying to use the natcap.invest API but it seems that C++ libraries are missing.
the error message that appears is the following:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: Microsoft C++ Build Tools - Visual Studio

I visited the link and I downloaded the application

I installed several components but I am not familiar with C++ and I don’t know where are the missing libraries.

Hi @aant.gis , this page might have some helpful info for you. It mentions which exact build tools you probably need. WindowsCompilers - Python Wiki

I’m guessing you got this error after a pip install natcap.invest ?

If you still do have compilation errors, you could try using conda to first install some of the invest dependencies. Conda provides compiled binaries for libraries like gdal so you don’t have to compile them locally.

For example,
conda install -c conda-forge "gdal>=3" numpy shapely rtree
pip install natcap.invest

1 Like