Conda: Command not found

14,537

The difference between bash and zshell are minimal. They are both a "shell" that run in the terminal. A shell is what allows you to run commands in the terminal. It has its own language called bash or alternatively shell scripting. If you have ever typed ls or cd in a terminal, you are using bash commands to move around or look at things in the terminal. (The terminal itself is just the little oftentimes black square you type into.) It doesn't really matter which one you pick at this point, but you should just go with one.

If you pick bash, the files that interact with it will be under your home directory, the error tells you exactly where. /Users/eyan/.bash_profile the .bash_profile sets some configurations for bash.

If you pick zshell, the files will instead of starting with '.bash_ they'll start with .zsh the most common one will be .zshrc and it will be in the same home directory. So /Users/eyan/.zshrc will be the config file for zshell.

Pick one and just stay with it for now.

In either case, you want to initialize conda.

In your terminal, if you type:

which conda

It should tell you where your conda is installed. If you get a bunch of nonsense running that, try which python. One of them should give you something like this output:

/Users/eyan/opt/anaconda3/bin/python

Change the python in that line to activate and add the command source to the front. So type:

source /Users/eyan/opt/anaconda3/bin/activate

Once you've done that type:

conda init

All of this is done in the terminal. And that should add a bunch of stuff to your shell profiles. (That's those files in your home directory like .bash and .zshrc.)

If you close and reopen your terminal or type EXEC $SHELL in the same terminal window, you should be able to use conda.

You can also see what was added to your bash (or zsh) profiles by typing:

cat /Users/eyan/.bash_profile

(Or if you've chosen zshell, run cat /Users/eyan/.zshrc)

You'll see that conda added quite a few lines to it. Don't worry about what those lines do for now, but you can see them there.

Share:
14,537
Nicholas TJ
Author by

Nicholas TJ

{Hello}

Updated on June 04, 2022

Comments

  • Nicholas TJ
    Nicholas TJ almost 2 years

    I'm a 17-year-old, and I am new to programming. I installed anaconda and python on my laptop however every time that I run code in Sublime Text it gives this error before printing whatever I want it to print: /Users/eyan/.bash_profile: line 20: conda: command not found It's really annoying so is there a way to get rid of it.

    • Ollie in PGH
      Ollie in PGH about 4 years
      How long since you installed anaconda? Have you closed and reopened your terminal or ran EXEC $SHELL in the terminal since installing?
    • Nicholas TJ
      Nicholas TJ about 4 years
      I'm guessing your conda installation is not on your windows path. Either (1) you uninstall and reinstall your anaconda completely, or, (2) you find your anaconda installation and place it in your windows PATH link.
    • Admin
      Admin about 4 years
      @NicholasTJ I'm working on Mac Catalina
    • Admin
      Admin about 4 years
      @OllieinPGH Yes I'm closed and reopened and it's still there. Also I dont know how to run EXEC $SHELL because it's giving me an error when I run it. Sorry I'm a beginner and don't know how to do these things yet
  • Admin
    Admin about 4 years
    I'm using a mac catalina and I'm also a bit confused between what bash and zsh are and which one I should use. Whenever I go terminal preferences shells open with command (complete path) and make it /bin/bash it gives this error when I open the terminal : -bash: conda: command not found The default interactive shell is now zsh. To update your account to use zsh, please run chsh -s /bin/zsh. For more details, please visit support.apple.com/kb/HT208050. But whenever I use /bin/zsh it doesn't give that error on terminal only on sublime text
  • Admin
    Admin about 4 years
    I tried both the inputs you wrote and they said this: -bash: /absolute/path/to/anaconda3/folder/bin/conda: No such file or directory
  • Admin
    Admin about 4 years
    I tried those two and it gave me: zsh: no such file or directory: /Users/eyan/anaconda3/bin/conda
  • dzang
    dzang about 4 years
    If you used a graphical installer try: ~/opt/anaconda3/bin/conda init and then source .bash_profile