Install python via conda

Dear all,

I have seen in the forum, that the InVEST python code is not workig with Python 3.12.4.
Therefore I tried to establish a new environment as mentiond and Installing the python code via conda.
→ However, I got a syntax error

Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license()” for more information.

conda create -n env-invest “python=3.11”
conda activate env-invest
conda install natcap.invest -c conda-forge
SyntaxError: invalid syntax

Thanks
Sibylle

Did you type these conda commands into the Python interpreter? These are actually not Python code, that’s why Python issued the SyntaxError.

The conda commands are meant to be entered into a command prompt such as CMD or Terminal. And then after you create the environment, activate it, and install natcap.invest, then you could run Python from the activated environment.

Hello Dave

Thank you very much. Yes I was not aware that I need cmd before the python interpreter.

In cmd I got the following error:
The command “conda” is either misspelled or could not be found.

Kind regards
Sibylle

Hi @sibylles ,

The command “conda” is either misspelled or could not be found.

This indicates that conda has not been installed on your system. That’s the first step. Installing conda — conda 24.5.1.dev78 documentation

Dear Dave

Thanks. Yes I installed Conda (see fig), by the miniconda installer. However, I got the same message.
Do I need to install conda at the same place as python or InVEST?

Kind regards
Sibylle