0
0

install mini-forge systemwide on RockyLinux 8.8

Last updated at Posted at 2024-10-03

TL;DR

  • python 3.11 on systemwide-pyenv(必須ではないが、念のため別で入れておく)
  • install mini-forge(これから入れる)

requirement

pyenvをsystemwideに入れる方法を実施済みであること(この記事はRockyLinux 9.4で試したが、RockyLinux 8.8でもまったく同様に動いた)

pyenv

install mini-forge

pyenv install miniforge3

現在の最新版、miniforge3-24.3.0-0が入った。

pyenv local miniforge3-24.3.0-0
python -V
# => Python 3.10.14

conda

init

conda init
exec -l $SHELL

.bashrcを元に戻すには

conda init --reverse bash

create conda env

conda create -n py310 python=3.10.14
conda activate py310

install tensorflow

conda install conda-forge::tensorflow

check

check.py
import tensorflow as tf
print(tf.__version__)

install transformer

conda install -c huggingface transformers

install ML

conda install -c conda-forge scikit-learn
conda install -c conda-forge pandas
conda install -c conda-forge jupyterlab
conda install -c pytorch torchvision
conda install -c conda-forge matplotlib
conda install -c conda-forge polars

cleanup

conda deactivate

conda init --reverse bash
exec -l $SHELL

これでログインシェルが元に戻る

use conda from another user

login

su - issei

別のユーザなら誰でもよい

pyenv

pyenv versions

出力はこうなった(別で3.11.10をインストール済み)

  3.11.10
  miniforge3-24.3.0-0
  miniforge3-24.3.0-0/envs/py310

mini-forgeを使うにはこうすれば良いようだ

pyenv local miniforge3-24.3.0-0

conda activate

conda init
exec -l $SHELL
conda env list

一覧としてはこうなった

# conda environments:
#
base                     /usr/local/pyenv/versions/miniforge3-24.3.0-0
py310                    /usr/local/pyenv/versions/miniforge3-24.3.0-0/envs/py310
conda activate py310

conda deactivate

conda deactivate

.bashrcを元に戻すには

conda init --reverse bash

unset pyenv

rm .python-version

補足:proxy突破のための設定

こんなエラーが出ていたらSSL認証の省略も含めて仕込む

CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue.
~/.condarc
proxy_servers:
  http: http://<host>:<port>
  https: http://<host>:<port>

ssl_verify: false

補足:pyenvとは別にmini-forgeを入れたい

結論:systemwideの場合は、やめたほうが良い
PATHの読み込み順序の不整合が解消困難になるので、pyenvとは別にmini-forgeアプリを単体でインストールするのは避けた方が良かった。(これを試したvagrant vmが一つ、エントロピーの海に沈んだ。。。)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0