Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

conda source deactivate : bash: deactivate: No such file or directory

I installed Conda at a different location than the default location on Ubuntu 16.4 using the official installation helper.

Now conda create and source activate works, but source deactivate gives me the error:

(deep) yuqiong@yuqiong-G7-7588:/media/yuqiong/DATA$ source deactivate
bash: deactivate: No such file or directory

I checked this issue on Github: #458: "Using source deactivate on a conda env fails unless the root anaconda directory is in PATH". It seems to be related, but I do not understand what happens when I run source deactivate inside a conda environment. Is it because something is wrong with my PATH variables?

Here is the part of my /.bashrc related to Conda, if helpful.

Thanks so much for your help!

# added by Anaconda3 5.3.1 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/media/yuqiong/DATA/Anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/media/yuqiong/DATA/Anaconda3/etc/profile.d/conda.sh" ]; then
        . "/media/yuqiong/DATA/Anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/media/yuqiong/DATA/Anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

### conda shortcuts
function actv() {
    #do things with parameters like $1 such as
    source activate "$1"
}
like image 948
yuqli Avatar asked Nov 24 '18 02:11

yuqli


3 Answers

So I still have not figured out why source deactivate does not work anymore, but the good thing is conda deactivate works. I'm sticking with that now.

And I think the problem is I do not understand how conda works... Here is a gentle intro to package manager if anyone's interested...https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527

like image 59
yuqli Avatar answered Nov 18 '22 07:11

yuqli


Use

conda deactivate

To deactivate or to go to the base source and then you can use

conda info --envs

to get the list of available sources

source activate <source_name>

and to activate a particular source.

Refer this for more -> Managing environments - conda.io

like image 5
Sundeep Pidugu Avatar answered Nov 18 '22 05:11

Sundeep Pidugu


Just Put

conda deactivate

good to know

conda activate and conda deactivate only work on conda 4.6 and later versions

like image 1
Ashiq Imran Avatar answered Nov 18 '22 07:11

Ashiq Imran