When using conda, "source activate [env_name]" doesn't work but "conda activate [env_name]" works
Solution 1:
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 $PATH
To 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!
Solution 2:
This 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