How to run Conda?

2020-01-22 12:32发布

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 copying and pasting the following line into my console:

conda create -n py33 python=3.3 anaconda

However, that gives me an error:

-bash: conda: command not found

What do I need to do to run Conda?

I am working on a Linux system.

30条回答
ら.Afraid
2楼-- · 2020-01-22 13:00

you might want to try this:

for anaconda 2 :

export PATH=~/anaconda2/bin:$PATH

for anaconda 3 :

export PATH=~/anaconda3/bin:$PATH

for anaconda 4 :

Use the Anaconda Prompt

and then

conda --version

to confirm that it worked. The export PATH=~/anaconda3/bin:$PATH works but stops when you exit the terminal in order change that you have to run sudo nano ~/.bashrc and then copy the path into the file and save it after that you activate the changes using source .bashrc.

check with conda install anaconda-navigator if not installed follow the anaconda install instructions again

follow along with this video https://youtu.be/Pr25JlaXhpc

查看更多
做自己的国王
3楼-- · 2020-01-22 13:00

This info is current as of today, August 10, 2016. Here are the exact steps I took to fix this using methods posted above. I did not see anyone post: export PATH=$PATH:$HOME/anaconda/bin (you need to add export to the beginning of the line).

Here it is, step-by-step:

For anyone running into the same problem while using oh-my-zsh, you need to do the following:

-Open your .zshrc in your terminal. I am using iTerm 2 and have Sublime Text 3 as my default text editor:

subl ~/.zshrc

-Once the file opens in your text editor, scroll to the very bottom and add:

export PATH=$PATH:$HOME/anaconda/bin

-Save the file, then close it.

-Close your terminal, then relaunch it.

-Once back in your terminal, type:

conda --v

You should then see the version of conda installed printed on your screen.


If you're using zsh, then after doing that, your terminal may show you zsh: command not found: rvm-prompt.

The solution is:

  1. add alias rvm-prompt=$HOME/.rvm/bin/rvm-prompt within .zshrc file.
  2. type source .zshrc.

Then the zsh: command not found: rvm-prompt will disappear.

查看更多
甜甜的少女心
4楼-- · 2020-01-22 13:01

Answer for

  • Anaconda3 5.2.0 installer
  • macOS HighSierra
  • ZSH

  1. Unfortunately, the installer puts the PATH definition only into .bash_profile, but not the .zshrc config.
  2. Contrary to the given answers, it doesn't (necessarily) install in ~/anaconda3/, but instead in /anaconda3/.

The PATHdefintion in .zshrc must therefore be this:

...
# Anaconda3
export PATH="/anaconda3/bin:$PATH"
...
查看更多
beautiful°
5楼-- · 2020-01-22 13:03

For Windows:

A recent Anaconda(version 4.4.0) changed some directories. You can find "conda" in Anaconda3/Scripts, instead of Anaconda3/bin.

查看更多
兄弟一词,经得起流年.
6楼-- · 2020-01-22 13:05

Edit ~/.bash_profile, add this to it.

PATH=$PATH:$HOME/anaconda/bin

then run

source ~/.bash_profile

Hope can help you.

查看更多
狗以群分
7楼-- · 2020-01-22 13:05

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
查看更多
登录 后发表回答