Usage of Python ================================= About using Python ------------------------------------ In this system, pyenv can be installed in the user's environment by executing the following script. Python version control is possible with pyenv. Please see below for details. Install pyenv ------------------------------------ Execute the following command to install pyenv on super and gpu. .. code-block :: none bash /work/app/pyenv/pyenv-setup.bash Backing up the pyenv environment from the previous system ------------------------------------------------------------------------ If you used the pyenv environment in the previous system, you will need to back up the old pyenv environment. Please back up the old environment with the command below. .. code-block :: none mv ~/.pyenv-super ~/.pyenv-super.old mv ~/.pyenv-gpu ~/.pyenv-gpu.old Setting environment variables ------------------------------------ The pyenv environment variable file is located in /work/app/pyenv/bash_env. If you want to load the pyenv environment by default, run the command below. .. code-block :: none echo "source /work/app/pyenv/bash_env" >> ~/.bash_profile Operational check ------------------------------------ After installing pyenv, log out from the front end node once, log in again, and then execute the following command. .. code-block :: none pyenv --version pyenv 1.2.8-5-gec9fb549 ←The version may be different. Basic usage ------------------------------------ ・Install Python using pyenv .. code-block :: none pyenv install --list ←View available Python versions ・・・・ pyenv install 3.7.8 ←Install Python 3.7.8 ・Switch python versions .. code-block :: none pyenv versions ←Check the installed version * system (set by /home/userA/.pyenv/version) 3.7.8 pyenv global 3.7.8 ←Switch to Python 3.7.8 python --version You can also add packages using pip. For more detailed usage, please check the pyenv documentation etc. `Simple Python version management `_ Execution method ------------------------------------ Execute Python programs with high load on compute nodes instead of front end nodes. ・A example for interactive mode .. code-block :: none userA@gpu2:~> qsub -I -q IP_001 qsub: waiting for job 70568.gpu1 to start qsub: job 70568.gpu1 ready -bash-4.2$ python Python 3.7.8 (default, Mar 25 2021, 09:54:46) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> You may also execute as a job script. ・A example for job script .. code-block :: none #!/bin/sh #PBS -l select=1 #PBS -q CA_001 #PBS -N sample cd $PBS_O_WORKDIR python program.py