Skip to content
Advertisement

Need the full path when activating Conda environment?

I’m new to the Conda environment and I was trying to create an environment by conda create -n chip python=2.7, and then source activate chip to activate the environment, but then I got the error message:

Could not find conda environment: chip
You can list all discoverable environments with `conda info --envs`.

And conda info --envs returned me:

# conda environments:
#
base                  *  /Users/yin/miniconda3
                         /anaconda3
                         /anaconda3/envs/chip

I tried source activate /anaconda3/envs/chip and it worked.
So can I add a name to my new environment (e.g. chip) so that I can activate it without typing the full path?
Thank you!

Advertisement

Answer

How many conda installations do you have and how did you create the chip environment? Based on your output the path for the conda executable is pointing to the conda installation in /Users/yin/miniconda3 and it may not know about environments installed in other directory trees.

When you create a conda environment using conda create -n chip it should be created in the envs sub-directory of where your conda distribution is installed, i.e., /Users/yin/miniconda3/envs/chip. Then you can refer to the environment by its name, i.e., source activate chip.

When you create a conda environment using conda create -p the_env_path it will be created in the_env_path and you will have to refer to it by its path when using activate.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement