Pacific-GPUにおける仮想環境を用いたpython 3.12またはpython 3.11 (wrf解析用)の実行手順は以下の通り。なおwrf解析用のpython 3.11環境は、wrf-pythonがpython 3.12にはインストールできなかったが、3.11いはできたおで、wrf解析に最低必要なパッケージのみインストールしたものである。
1.初回のみの設定
まず,ユーザーディレクトリ配下の「.bashrc」に下記の設定を追記する.
export PYENV_ROOT="/usr/local/pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
alias activatepy311wrf="source $PYENV_ROOT/versions/anaconda3-2024.06-1/bin/activate py3.11wrf"
alias activatepy312="source $PYENV_ROOT/versions/anaconda3-2024.06-1/bin/activate py3.12"
シェルの再起動を以下のように行うか,ログインし直す.
$ exec $SHELL -l
2. 毎回の実行内容
仮想環境を実行するために,以下の通り,コマンドプロンポトから入力する.python 3.12であれば、
$ activatepy312
プロンプトに(py3.12)が表示されると,仮想環境が正常に実行されていることを意味する.
その状態でipythonまたはpythonと入力すると,python 3.12を実行できる.同様にpytthon 3.11(wrf解析用)を使うには、
$ activatepy311wrf
とする。
The procedure for running python 3.12 or python 3.11 (for wrf analysis) using the virtual environment on Pacific-GPU is as follows. The python 3.11 environment for wrf analysis was created by installing only the minimum necessary packages for wrf analysis, because wrf-python could not be installed in python 3.12 but could be installed in python 3.11.
1. Initial setup
First, add the following settings to “.bashrc” under the user directory.export PYENV_ROOT="/usr/local/pyenv”
export PATH="$PYENV_ROOT/bin:$PATH”
alias activatepy311wrf="source $PYENV_ROOT/versions/anaconda3-2024.06-1/bin/activate py3.11wrf”
alias activatepy312="source $PYENV_ROOT/versions/anaconda3-2024.06-1/bin/activate py3.12”
Restart the shell as follows or log in again.
$ exec $SHELL -l
2. what to execute each time
To run the virtual environment, enter the following from the command prompt, if you are using python 3.12,
$ activatepy312
When (py3.12) appears at the prompt, it means that the virtual environment is running successfully.
In that state, typing ipython or python will execute python 3.12. Similarly, to use python 3.11 (for wrf analysis), type
$ activatepy311wrf