The Cray Programming Environment features a Python 3 installation provided by Cray, accessible by loading the cray-python
modulefile.
Packages provided by cray-python/3.9.12.1
Package Version ------------------ --------- atomicwrites 1.4.0 attrs 21.2.0 Cython 0.29.24 dask 2021.10.0 fsspec 2022.3.0 importlib-metadata 0.0.0 iniconfig 1.1.1 locket 0.2.1 more-itertools 8.10.0 mpi4py 3.1.3 nose 1.3.7 numpy 1.20.3 packaging 21.0 pandas 1.3.4 partd 1.2.0 pip 22.0.4 pluggy 0.13.1 py 1.10.0 pybind11 2.6.2 pyparsing 3.0.4 pytest 0.0.0 python-dateutil 2.8.2 pytz 2021.3 PyYAML 6.0 scipy 1.6.2 setuptools 58.1.0 setuptools-scm 6.0.1 six 1.16.0 toml 0.10.2 toolz 0.11.1 wcwidth 0.2.5 zipp 0.0.0
Packages provided as stand-alone modulefiles
Additional Python packages are provided on Piz Daint by the stand-alone modulefiles jupyterlab
, h5py
, matplotlib
, netcdf4-python
, numpy
and pycuda
, that will be available after loading either daint-gpu
or daint-mc
as in the example below:
module load daint-gpu # (or daint-mc) module avail h5py
The modules listed above will automatically load the cray-python
modulefile as a dependency: to avoid conflicts, please do not load any additional python
modulefiles manually.
Virtual Environments
To create a virtual environment called "myvenv", issue the following commands:
module load cray-python python -m venv --system-site-packages myvenv
Activate the virtual environment with the following command:
source ./myvenv/bin/activate
Now you can install Python packages with:
pip install <package-name>[==<version>]
You can use the following options to control the access to system installed packages
- The option
--system-site-packages
gives the virtual environment access to all modules already installed in the system (e.g numpy, ...) - If you would like to create a more isolated virtual environment, you should omit that option.
To deactivate the environment, run the following command in your terminal:
deactivate