conda env list
or conda info -e
shows
py35 python=3.5
as one of the environment.
How to activate conda env which has space in its name?
conda env list
or conda info -e
shows
py35 python=3.5
as one of the environment.
How to activate conda env which has space in its name?
tl;dr Surround the environment name with DOUBLE quotes.
@centau you can most definitely create environments with spaces in the name.
Duplicating the problem:
conda create -n "foo bar" python=3.5
Then inspecting the environments:
conda info -e
produces:
# conda environments:
#
foo bar C:\Users\edill\AppData\Local\Continuum\Miniconda3\envs\foo bar
root * C:\Users\edill\AppData\Local\Continuum\Miniconda3
So you can see that there is an environment with the name "foo bar"
Then to activate it:
activate "foo bar"
Which modifies the command line to show:
(foo bar) C:\Users\edill>
So at this point I am reasonably confident that all is working properly with a space in the environment name, but let's just double check to make sure. Check the file that one of the built in modules is coming from:
(foo bar) C:\Users\edill>python -c "import os; print(os.__file__)"
Shows that this built in os
module is indeed coming from the foo bar
environment
C:\Users\edill\AppData\Local\Continuum\Miniconda3\envs\foo bar\lib\os.py
I've found a solution while trying to install conda environment in my Windows.
I have a space in one of my directory's name between My and MS.
C:\Users\My MS\python\project_1\env
So I put " " to encase the whole directory to activate the environment:
$ conda activate "C:\Users\My MS\python\project_1\env"
Enter the name of the environment in double quotes.
e.g. when I activate my environment named - deep learning I use following command:
conda activate "deep learning"