~> conda install pandas
fish: Unknown command 'conda'
I understand that I need to add conda
to PATH, but no matter what combinations of commands I tried, I could get it to work. I still get the above error.
Install Anaconda
Run conda init fish
In your ~/.config/fish/config.fish
you should see some lines added by Anaconda:
#>>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
eval your/path/to/anaconda3/bin/conda "shell.fish" "hook" $argv | source
# <<< conda initialize <<<
Restart the terminal. You should see now Anaconda activating the (base)
environment. Check running echo $CONDA_PREFIX
the loaded environment is pointing in the right place.
Hope this helps. Let us know if you still have problems
conda
command wasn't in PATH
you'll maybe have to execute conda with it's full path. It can for example be found by which conda
. For me it was at /opt/anaconda/bin/conda
or at /opt/anaconda/condabin/conda
.
Where is conda
installed? If it's in ~/anaconda/bin
, then you want to run this:
Try set -U fish_user_paths ~/anaconda/bin $fish_user_paths
Modifying PATH is discussed in the fish tutorial
Hope that helps!
you can do it in one Line and don't bother yourself (MacOS and Linux)
/(your conda installation path)/bin/conda init fish
your condo installation usually in '/Users/- your UserName -/anaconda3'
if someone want to know about install fish, best way is Homebrew.
after brew install fish
you mush add fish to supportable shells in /etc/shells
.
and then with chsh
change default shell to fish
.
if it's not clear ask in comment!
I assume you have 'config.fish'(create if you don't have) file in ~/.config/fish/ directory. Now add the following to the file 'config.fish':
set PATH /home/<user>/anaconda3/bin $PATH
Then save the file. Close the current terminal (fish shell) and open again. Now you can use Anaconda's python.
To check: run python3
and you will see:
Python 3.7.1 (default, Dec 14 2018, 19:28:38)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
To use conda activate env
command
Enter this command on your fish shell:
conda init fish
Now, restart the terminal and use any conda command you like.
Conda command will not work until you run the conda init fish. but on fish terminal it will also not work.
$ bash
conda init fish
You are done
If you have installed conda
prior to installing fish
, you most likely installed it using zsh
which comes as default since macOS Catalina. In this case you do not need to reinstall conda
, simply switch back to the zsh
shell, like so:
zsh
then init conda from zsh
conda init fish
Then you can go ahead and open a new terminal window. If the fish shell is automatically opening, you should be able to use the conda
command.
To verify, type
which conda
and if it's available, you should see the path to the installation.
If running conda init fish
prevents fish
from running (as it did for me), it would be better to just remove whatever conda has added to the ~/.config/fish/config.fish
file and just add the following line.
source /Users/yourname/anaconda3/etc/fish/conf.d/conda.fish
assuming Anaconda is installed in /Users/yourname/