DCC software — Python


This document describes the usage of Python modules using the modules as described here.

The Python modules are hidden in the sense that one has to first load the corresponding Python version before one sees all Python modules build for that version. This means that one would never mix two modules build for different Python versions.

If you have not loaded any Python module one only finds the basic Python versions installed:

$> module avail python
--- /dtu/sw/dcc/SL73/2019-jun/XeonE5-2660v2/modules/gnu/9.1.0 ---
python/2.7.16  python/3.7.3

Note that spyder, jupyter and jupyterlab are intrinsically available once python has been loaded.

Once you have loaded one of the versions more modules are made available in a new section (list is incomplete, check your-self):

$> module load python/3.7.3
$> module avail
--- /dtu/sw/dcc/SL73/2019-jun/XeonE5-2660v2/modules/gnu/9.1.0-python/3.7.3 ---
ase/3.17.0          mpmath/1.1.0       scikit-image/0.15.0  
asteval/0.9.13      netcdf4py/1.5.1.2  scikit-learn/0.21.2  
biopython/1.73      networkx/2.2       scikit-optimize/0.6  
bottleneck/1.2.1    numba/0.43.1       scipy/1.3.0          
cftime/1.0.3.4      numexpr/2.6.9      seaborn/0.9.0        
cython/0.29.7       numpy/1.16.4       sgdml/0.2.3          
dask/1.2.2          orthopy/0.5.3      sip/4.19.3           
distributed/1.28.1  pandas/0.24.2      sisl-dev/0           
gpaw/1.5.2          patsy/0.5.1        sisl/0.9.6           
h5py/2.9.0          petsc4py/3.11.0    slepc4py/3.11.0      
hotbit-dev/0        phono3py/1.17.0    statsmodels/0.9.0    
imageio/2.5.0       phonopy/2.1.3      symengine.py/0.4.0   
Inelastica-dev/0    pyamg/4.0.0        sympy/1.4            
Inelastica/1.3.6    pybind11/2.2.4     theano/1.0.4         
kwant/1.4.1         pyfftw/0.11.1      tinyarray/1.2.1      
llvmlite/0.28.0     pymc3/3.6          uncertainties/3.0.3  
lmfit/0.9.12        pytables/3.5.1     xarray/0.12.1        
matplotlib/3.1.0    pywavelets/1.0.2   yt/3.5.1             
meson/0.51.0        quadpy/0.12.10     
mpi4py/3.0.1        qutip/4.3.1        

Using pip install

We recommend you to use virtual environments for reproduceability and to ensure you don’t mess up your packages unintended, see https://www.hpc.dtu.dk/?page_id=3678.

If you need to install packages using pip (for Python-2)/pip3 (for Python-3) please do this (do NOT use pip install):

python -m pip install --user <list of packages>

where the --user flag tells Python to install the packages locally. If you forget the flag you will encounter an error looking like this:

PermissionError: [Errno 13] Permission denied: '<path to package installation>'

The modules installed by DCC automatically changes the default installation directory for python -m pip install commands. This means that any pip installed packages will only be available for exactly the loaded Python version. This ensures that your installed packages maintain compatibility if updating the Python version.