This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
guide:python [2021/12/09 16:42] 127.0.0.1 external edit |
guide:python [2022/06/13 11:58] (current) wikiadmin |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Use this command to get a full list: | Use this command to get a full list: | ||
| module avail chpc/python | module avail chpc/python | ||
| + | |||
| + | Note that the modules including anaconda are more recent and thus recommended over the plain Python modules, i.e., use one of: | ||
| + | |||
| + | chpc/ | ||
| + | chpc/ | ||
| + | chpc/ | ||
| + | chpc/ | ||
| + | chpc/ | ||
| + | |||
| + | > To check the version of Python provided by each, load the module (after purging any already loaded modules) and then run '' | ||
| + | |||
| + | login1:~$ module purge | ||
| + | login1:~$ module load chpc/ | ||
| + | login1:~$ python3 --version | ||
| + | Python 3.7.4 | ||
| + | login1:~$ module purge | ||
| + | login1:~$ module load chpc/ | ||
| + | login1:~$ python3 --version | ||
| + | Python 3.9.7 | ||
| + | login1: | ||
| + | |||
| + | |||
| All python modules should have mpi4py, numpy and scipy installed; however if matplotlib is required, please use anaconda (which also has the biggest range of 3rd-party python modules). The module '' | All python modules should have mpi4py, numpy and scipy installed; however if matplotlib is required, please use anaconda (which also has the biggest range of 3rd-party python modules). The module '' | ||
| Line 24: | Line 46: | ||
| You can find more information on user installs in the [[https:// | You can find more information on user installs in the [[https:// | ||
| - | As an alternative, | + | As an alternative, |
| + | |||
| + | To create a virtual environment called //myenv//, just cd to the place where you want the virtual environment to live --- for example | ||
| + | |||
| + | <code bash> | ||
| + | cd / | ||
| + | </ | ||
| + | |||
| + | where '' | ||
| - | To create a virtual environment called //myenv//, just cd to the place where you want the virtual environment to live (eg. '' | ||
| python3 -m venv myenv | python3 -m venv myenv | ||
| Line 35: | Line 64: | ||
| source / | source / | ||
| + | |||
| + | > Note the full path to the virtual environment is on your Lustre directory: ''/ | ||
| Again, there is more information in [[https:// | Again, there is more information in [[https:// | ||