I installed Anaconda and can run Python, so I assume that I installed it correctly. Following this introductory documentation, I am trying to install Python v3.3, so I am co
For Windows:
PATH=%USERPROFILE%\Continuum\Anaconda4.4.0\Library\bin;%PATH%
conda init
As pointed out in a different answer, manually adding Conda on $PATH
is no longer recommended as of v4.4.0 (see Release Notes). Furthermore, since Conda v4.6 new functionality to manage shell initialization via the conda init
command was introduced. Hence, the updated recommendation is to run
Unix/Linux
./anaconda3/bin/conda init
Windows
./anaconda3/Scripts/conda.exe init
You must launch a new shell or source your init file (e.g., source .bashrc
) for the changes to take effect.
This feature remains experimentally supported. I'd recommend running the above command with a --dry-run|-d
flag and a verbosity (-vv
) flag, in order to see exactly what it would do. If you don't already have a Conda-managed section in your shell run commands file (e.g., .bashrc
), then this should appear like a straight-forward insertion of some new lines. If it isn't such a straightforward insertion, I'd recommend clearing any previous Conda sections from $PATH
and the relevant shell initialization files (e.g., bashrc
) first.
You may need to explicitly identify your shell to Conda. For example, if you run zsh
(macOS Catalina default) instead of bash
then you would run
./anaconda3/bin/conda init zsh
Please see ./anaconda3/bin/conda init --help
for a comprehensive list of supported shells.
Conda v4.6.9 introduced a --reverse
flag that automates removing the changes that are inserted by conda init
.
System: macOS
I installed Anaconda first, and everything worked well. Then I installed iTerm2 and when I typed Python
iTerm2 gave me the default Python. Here is how to find your Anaconda Python back:
Open your .zshrc
file. For example, vim ~/.zshrc
Then add export PATH="/Users/yourusername/anaconda2/bin:$PATH"
to the last line of the file. Note that you need to replace the yourusername
to your user name and make sure you have anaconda2. An easy way is to copy this line from ~/.bash_profile
Save the file, close it, relaunch the terminal and now Anaconda Python should be back.
If you have just installed MiniConda or Anaconda make sure you re-run your terminal.
From this, I mean close and open your terminal and then try conda list to verify your installation
For me, this worked!!
First, check the location of anaconda, for me I installed anaconda3 at / directory which I access with /anaconda3
Then in your terminal, input export PATH="<base location>/anaconda3/bin:$PATH"
for me it's export PATH="/anaconda3/bin:$PATH"
.
Finally, input source $/anaconda3/bin/activate
. For you, just change to your location.
Now, you could try conda list to test.
Also, visit intallation guide
Mostly it is because when we install Anaconda in the end it adds the anaconda path to PATH variable in .bashrc file. So we just need to restart the terminal or just do
source ~/.bashrc
if still it don't work then follow this commands.
cat >> ~/.bashrc
paste the below command for anaconda3
export PATH=~/anaconda3/bin:$PATH
hit Enter then ctrl+d
source ~/.bashrc