I have been using conda for a few months. The following is the version that I'm using:
conda -V
conda 4.5.4Previously, to activate or to deactivate the conda environment, I think I have used the following command:
source activate [env_name]
source deactivateHowever, recently, the above commands don't work on my machine for unknown reason. The following is the result:
bash: activate: No such file or directoryMore strangely, the following commands work:
conda activate [env_name]
conda deactivateCould you suggest what might have happened and how to fix this problem?
2 Answers
The problem may be because the Anaconda directory is not part of your PATH. You can check this by entering the following command in your terminal. If you don't see the Anaconda directory(Looks something like this /home/user/anaconda3/bin), you found your issue!
echo $PATHTo fix this problem, you can simply enter the following command in the terminal where user is your username.
export PATH="/home/user/anaconda3/bin:$PATH"If this helped, please mark this as an accepted answer so that your original question can be marked as solved!
1This behavior is since 4.4 version. Take a look at this page.
Conda 4.4 introduced new scripts that make activation behavior uniform across operating systems. Where you once had “source activate envname” on unix, and just “activate envname” on windows, Conda 4.4 allowed “conda activate envname”.
You can read more on 4.4 changes here