Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add conda to path in fish

Tags:

conda

fish

~> 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.

like image 305
Anarcho-Chossid Avatar asked Dec 15 '15 02:12

Anarcho-Chossid


People also ask

What does conda init do?

The conda init command places code in your . bashrc file that modifies, among other things, the PATH environment variable by prepending to it the path of the base conda environment. The . bashrc file is executed before the default system modules are loaded.

How do you set up a fish?

Simply run fish_config to open the web client. From there, you can choose the themes, colors, prompts, inspect the FSH functions and variables, and see the history of commands used. Changes are, in turn, stored in the ~/. config/fish folder and can be accessed and edited there to dodge the optional web configuration.


3 Answers

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!

like image 173
ridiculous_fish Avatar answered Sep 18 '22 15:09

ridiculous_fish


  1. Install Anaconda

  2. Run conda init fish

  3. 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 <<<
    
  4. 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

like image 30
nicdelillo Avatar answered Sep 18 '22 15:09

nicdelillo


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!

like image 29
moraei Avatar answered Sep 21 '22 15:09

moraei