Anacondaをインストールする
anacondaはそんな好きではないが、まぁ科学計算の人とかにとっては楽なので、これをインストールする。
wasatのサーバーにデフォルトで用意しても良かったが、干渉させないために各々のディレクトリでやってもらう。
またanaconda嫌いの人は普通にpython officialを導入してくれ。
本題
以下のサイトより最新のLinuxのダウンロードURLをゲットする。
https://www.anaconda.com/download/success
その上で
wget https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh
ダウンロードしたファイルを起動させる。
sh Anaconda3-2024.06-1-Linux-x86_64.sh
ライセンスに同意してインストールすれば完了。
Version 4.0 | Last Modified: March 31, 2024 | ANACONDA TOS
Do you accept the license terms? [yes|no]
>>> yes
Anaconda3 will now be installed into this location:
/home/nishihama/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/nishihama/anaconda3] >>>
PREFIX=/home/nishihama/anaconda3
Unpacking payload ...
インストールしたらcondaを自動的にactivateさせるか聞かれる。
condaをしようするならyesを選べば良い。
私はこのanaconda baseしか使わないのでnoにしとく。
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
run the following command when conda is activated:
conda config --set auto_activate_base false
You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>>
次にpathを通す。
(conda initをyesにした人は別にpathは通さなくてもanacondaがやってくれてる。)
echo "export PATH=/home/nishihama/anaconda3/bin:$PATH" >> .zshrc
で追記して完了。
注意
wasatではカーネル選択にて
/usr/bin/python3
/bin/python3
が使用できるが、これらを使用したりpipするのはやめよう!