Search code examples
ubuntuanacondacondaotree

Conda can't find environment


I cloned an Otree project from a colleague via GitHub and want to set up the survey. When i follow her instructions by typing conda activate otree_env i get the error: Could not find conda environment: otree_env.

When i type the complete path, like conda activate /home/path/to/environment/otree_env, i get the error: Not a conda environment: home/path/to/environment/otree_env.

It seems conda does not discover the environment as conda info --envs doesn't list the otree environment.

Can anybody help me out?


Solution

  • Unexpectedly I had a similar problem in Windows in Visual Studio Code terminal when I run activate C:\...\myEnvironmentFolder with the message Could not find conda environment: C:... The following command helped me:

    source C:/myPath/Anaconda3/etc/profile.d/conda.sh
    

    Then running activate C:\...\myEnvironmentFolder gave the desired effect

    If you have the problem like this in cmd console, then, probably, you need to set the path in

    Control panel -> System -> Advanced system settings -> User / System variables -> Path -> Edit -> New ->
    and add
    C:\ProgramData\Anaconda3\Scripts
    C:\ProgramData\Anaconda3
    C:\ProgramData\Anaconda3\Library\bin