Add PATH when installing Anaconda3 in the terminal Change shell and hide (base)

Tips for installing Anaconda 3

What i did

I installed Anaconda3 on a remote Linux (login shell: zsh) machine from a mac.

Where I ate time

  1. I have written my PATH to ~ / .bashrc. I want to change to ~ / .zshrc in the login shell.
  2. After installation, the character (base) was added to the terminal. I want to erase it.

Anaconda3 installation procedure

I wrote it in .bashrc here.

zsh


wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
zsh Anaconda3-2019.10-Linux-x86_64.sh
#The license etc. will come out so check it and yes
#Confirm install location. This time it is directly under home, so enter as it is

#Here, without noticing the story of Initialize Anaconda 3, enter as it is ← Cause of this failure
#Originally
#Do you wish the installer to initialize Anaconda3
#in your /home/hogeuser/.bashrc ? [yes|no]
#[no] >>> /home/hogeuser/.zshrc ← here. Should have done this

I can't help what I did

Repair with conda init while referring to conda with an absolute path. Of course, if you change the zsh part, you can use fish

zsh


/home/hogeuser/anaconda3/bin/conda init zsh
source ~/.zshrc

It is now added to zsh's PATH.

(base) is now displayed in the terminal every time

I don't understand why I added this feature by default. Let's erase it.

zsh


conda config --set changeps1 False

If it is not fixed by ENTER, it is completed by restarting the terminal.

Digression

By the way, the character string that appears on the left side when typing a command in the terminal is It's in an environment variable called $ PS1. You can change the color and () a little cool by playing with this as you like. For example.

.zshrc


PS1='
%F{white}>>>%f %B%F{cyan}%m%f%b:%B%F{blue}%~%f%b:%B%F{red}%W:%T%f%b
%B%F{blue}%n%f%b [%?] %B%F{cyan}>%f%b '

Then

>>> foomachine:/home/hogeuser/anaconda3:01/29/20:10:54 hogeuser [0] >

I feel like this. If you look it up, there are many, so you can play for a few hours. that's all.

Recommended Posts

Add PATH when installing Anaconda3 in the terminal Change shell and hide (base)
How to delete "(base)" that appears in the terminal when Anaconda is installed on Mac
The result of installing python in Anaconda
Precautions when installing packages in the conda environment
When the axis and label overlap in matplotlib
Rename and replace remote files using NcFTP in the shell
Change the message displayed when logging in to Raspberry Pi
Write a script in Shell and Python to notify you in Slack when the process is finished