Many thank @edavis
I tried now the InVEST sample data
Unfortunately I got an error, possibly as I am working on a newer GDAL version (I am not allowed to install 3.3.0, SSL challenge)
(env-invest) C:\Users\f80809100>gdalinfo --version
GDAL 3.9.2, released 2024/08/13
For the json input, is it possible to provide the path to the code? I suppose I should not change the directory because then the InVEST python code will not be found.
Code
(env-invest) C:\Users\f80809100>invest -vvv run pollination -d pollination_willamette.invs.json -w O:/Data-Work/27_Natural_Resources-RE/271_KLIM_Work/CC_Impacts/NCCS/Data/M2b_Pollination/InVEST/InVEST_Sample-Data
09/21/2024 14:13:16 natcap.invest.cli INFO Imported target natcap.invest.pollination from <module ‘natcap.invest.pollination’ from ‘C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\pollination.py’>
09/21/2024 14:13:16 natcap.invest.utils Level 100 Writing log messages to [O:/Data-Work/27_Natural_Resources-RE/271_KLIM_Work/CC_Impacts/NCCS/Data/M2b_Pollination/InVEST/InVEST_Sample-Data\InVEST-natcap.invest.pollination-log-2024-09-21–14_13_16.txt]
09/21/2024 14:13:16 natcap.invest.cli Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.pollination 3.14.2:
farm_vector_path farms.shp
guild_table_path guild_table.csv
landcover_biophysical_table_path landcover_biophysical_table.csv
landcover_raster_path landcover.tif
results_suffix
workspace_dir O:/Data-Work/27_Natural_Resources-RE/271_KLIM_Work/CC_Impacts/NCCS/Data/M2b_Pollination/InVEST/InVEST_Sample-Data
09/21/2024 14:13:16 natcap.invest.utils ERROR Exception while executing natcap.invest.pollination
Traceback (most recent call last):
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\utils.py”, line 165, in prepare_workspace
yield
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\cli.py”, line 470, in main
model_module.execute(parsed_datastack.args)
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\pollination.py”, line 525, in execute
scenario_variables = _parse_scenario_variables(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\pollination.py”, line 1209, in _parse_scenario_variables
guild_df = validation.get_validated_dataframe(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\validation.py”, line 623, in get_validated_dataframe
df = utils.read_csv_to_dataframe(csv_path, **read_csv_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\utils.py”, line 438, in read_csv_to_dataframe
df = pandas.read_csv(
^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\parsers\readers.py”, line 1026, in read_csv
return _read(filepath_or_buffer, kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\parsers\readers.py”, line 620, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\parsers\readers.py”, line 1620, in init
self._engine = self._make_engine(f, self.engine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\parsers\readers.py”, line 1880, in _make_engine
self.handles = get_handle(
^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\common.py”, line 873, in get_handle
handle = open(
^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ‘guild_table.csv’
09/21/2024 14:13:16 natcap.invest.utils INFO Elapsed time: 0.16s
09/21/2024 14:13:16 natcap.invest.utils INFO Execution finished; version: 3.14.2
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in run_code
File "C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Scripts\invest.exe_main.py", line 7, in
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\cli.py”, line 470, in main
model_module.execute(parsed_datastack.args)
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\pollination.py”, line 525, in execute
scenario_variables = _parse_scenario_variables(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\pollination.py”, line 1209, in _parse_scenario_variables
guild_df = validation.get_validated_dataframe(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\validation.py”, line 623, in get_validated_dataframe
df = utils.read_csv_to_dataframe(csv_path, **read_csv_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\natcap\invest\utils.py”, line 438, in read_csv_to_dataframe
df = pandas.read_csv(
^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\parsers\readers.py”, line 1026, in read_csv
return _read(filepath_or_buffer, kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\parsers\readers.py”, line 620, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\parsers\readers.py”, line 1620, in init
self._engine = self._make_engine(f, self.engine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\parsers\readers.py”, line 1880, in _make_engine
self.handles = get_handle(
^^^^^^^^^^^
File “C:\Users\f80809100\AppData\Local\miniconda3\envs\env-invest\Lib\site-packages\pandas\io\common.py”, line 873, in get_handle
handle = open(
^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ‘guild_table.csv’
GDAL
(env-invest) C:\Users\f80809100>pip install gdal==3.3.0
Collecting gdal==3.3.0
Using cached GDAL-3.3.0.tar.gz (743 kB)
Preparing metadata (setup.py) … done
Building wheels for collected packages: gdal
Building wheel for gdal (setup.py) … error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [115 lines of output]
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: Microsoft C++ Build Tools - Visual Studio
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for gdal
Running setup.py clean for gdal
Failed to build gdal
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (gdal)