gtrichards / PHYS_T480_F18

Repository for PHYS T480/580 (Big Data Physics: Methods of Machine Learning) at Drexel University, Fall 2018
https://github.com/gtrichards/PHYS_T480_F18
MIT License
9 stars 5 forks source link

Mention how to enable Anaconda in fish shell #1

Open ejh92 opened 5 years ago

ejh92 commented 5 years ago

Since I enjoy using FISH, I found how to enable Anaconda in it, and was hoping it could be added to the introduction after BASH and TCSH (non-standard though it is).

You can add Anaconda to FISH's path by doing

 set -U fish_user_paths "$HOME/anaconda3/bin" $fish_user_paths

You only need to do this once, since it is a persistent change. Importantly, this command shouldn't be done in FISH's configuration file, since it will make $fish_user_paths longer each time FISH is started.

To create Python environments using Anaconda, you must have FISH evaluate the file $HOME/anaconda3/etc/fish/conf.d/conda.fish, which will add functions to FISH's function namespace. If you want these as soon as FISH opens , then this command should be done in FISH's configuration file ($HOME/.config/fish/config.fish) with the command

source "$HOME/anaconda3/etc/fish/conf.d/conda.fish"

Alternatively, you can symlink this file into FISH's function folder (~/.config/fish/functions).

This creates some functions and adds information to FISH's right-side prompt when an environment has been activated, such as with the command

conda activate py36

This command was able to successfully activate the above environment that was created in BASH. To have this environment loaded at the start, you just also put this command into the config.fish file.

To deactivate the environment, the command is simply

conda deactivate

and takes no arguments after deactivate.

This is mostly a write-up of the file conda.fish. Since FISH works a bit differently from the POSIX-ish shells, I figured it might be worth including.

ejh92 commented 4 years ago

If the bad directory is at the front of fish_user_paths, you should be able to do 'set -U fish_user_paths $fish_user_paths[2..-1]'.

I think you can also use 'set -Ue fish_user_paths[n]' where 'n' is the index of the bad directory. Remember the FISH's arrays start at 1. I haven't tried this way.

Please first try these on a test variable before using them on fish_user_paths. It has been a while since I've much used the shell.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Vinh Ton notifications@github.com Sent: Wednesday, July 17, 2019 7:46:25 AM To: gtrichards/PHYS_T480_F18 Cc: Hyatt,Earl; Author Subject: Re: [gtrichards/PHYS_T480_F18] Mention how to enable Anaconda in fish shell (#1)

External.

Hello,

I followed your instructions for miniconda3 instead of anaconda3 and, I used the first command without changing the directory path from anaconda3 to miniconda3. Now, I receive the warning:

set: Warning: $PATH entry "$HOME/anaconda3/bin" is not valid (No such file or directory)

Is there a way I can change the $PATH entry?

Thank you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgtrichards%2FPHYS_T480_F18%2Fissues%2F1%3Femail_source%3Dnotifications%26email_token%3DAKMCY5H2BVNLSARC76XRKIDP74BBDA5CNFSM4FWX4CL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2D5TGI%23issuecomment-512219545&data=02%7C01%7Cejh92%40drexel.edu%7C6441a8de7f2b4e97544e08d70aac65cf%7C3664e6fa47bd45a696708c4f080f8ca6%7C0%7C0%7C636989607866640162&sdata=bcYAja078FLE5ocCQ%2BRkoULO%2Fp5cziNQEuSP3bn%2B1aY%3D&reserved=0, or mute the threadhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKMCY5F3QYIADWGFFNJRVBTP74BBDANCNFSM4FWX4CLQ&data=02%7C01%7Cejh92%40drexel.edu%7C6441a8de7f2b4e97544e08d70aac65cf%7C3664e6fa47bd45a696708c4f080f8ca6%7C0%7C0%7C636989607866640162&sdata=n%2FgWOrf3Vx96YX3jyiZS9f%2FC3VOeyLTVuQpKfyP3N%2Bc%3D&reserved=0.