Create a virtual environment
conda create -n hoge anaconda
Check the created environment
conda info -e
Switch to the created environment
source activate hoge
Return from the created environment
source deactivate
You should get the following error
Error: activate must be sourced. Run 'source activate envname'
instead of 'activate envname'.
Usage: source activate ENV
adds the 'bin' directory of the environment ENV to the front of PATH.
ENV may either refer to just the name of the environment, or the full
prefix path
Because the activate command of pyenv has been executed Enter the full path so that the conda command can be executed, or register it in alias.
# .Added to zshrc
# for anaconda activate/deacitvate cmd
alias activate="source $HOME/.pyenv/versions/anaconda3-2.5.0/bin/activate"
alias deactivate="source $HOME/.pyenv/versions/anaconda3-2.5.0/bin/deactivate"
Delete the created environment
conda remove --name hoge --all
Recommended Posts