Skip to main content

python: Python scripting language

WARNING
*** DEPRECATED ***

NOTE: The authors of Python have stopped maintenance of all Python2 versions as of 1 Jan 2020. While the UMD Division of Information Technology continues to provide access to the existing Python2 installs for now, all Python2 installations are ***DEPRECATED*** and will not be upgraded, have new extensions installed, etc. It is likely that Python2 will not be made available when the Zaratan cluster is stood up.

All Python users are strongly encouraged to migrate to Python3.

Contents

  1. Overview of package
    1. General usage
  2. Availability of package by cluster
  3. System modules
  4. Installing modules
    1. Using setup.py
    2. Using virtual environments and pip
    3. Using conda
  5. Assorted Tips and Tricks
    1. Matplotlib Tricks
  6. Numba and GPU Support
  7. Using python with MPI

Overview of package

General information about package
Package: python
Description: Python scripting language
For more information: https://www.python.org
Categories:
License: OpenSource (Python Software Foundation)

General usage information

Python is a high-level scripting language.

This module will add the python and related commands to your path.

In case you need to link against this library in your code, the following environmental variables have been defined:

You will probably wish to use these by adding the following flags to your compilation command (e.g. to CFLAGS in your Makefile):

and the following flags to your link command (e.g. LDFLAGS in your Makefile):

Available versions of the package python, by cluster

This section lists the available versions of the package pythonon the different clusters.

Available versions of python on the Zaratab cluster

Available versions of python on the Zaratab cluster
Version Module tags CPU(s) optimized for GPU ready?
3.10.10 python/3.10.10 icelake, x86_64, zen2 Y
3.8.12 python/3.8.12 zen2 Y
WARNING
*** DEPRECATED ***

NOTE: The authors of Python have stopped maintenance of all Python2 versions as of 1 Jan 2020. While the UMD Division of Information Technology continues to provide access to the existing Python2 installs for now, all Python2 installations are ***DEPRECATED*** and will not be upgraded, have new extensions installed, etc. It is likely that Python2 will not be made available when the Zaratan cluster is stood up.

All Python users are strongly encouraged to migrate to Python3.

When using in conjunction with your own code, you might wish to note the compiler and MPI libraries used when the python binaries and packages were built. MPI in particular can be fussy and generate strange errors if the different parts of the code are linked against different MPI libraries (even different versions of OpenMPI or the same version of OpenMPI built with a different compiler), or if the mpirun command used to start the code is from a different MPI version or was built with a different compiler. In general, it is best to ensure everything is built with the same compiler and, if used, the same MPI library.

System modules

The system installations of Python include a large number of Python modules to enhance the capability of Python. The table below list those modules and version numbers for the various installations of Python which are made available with the "module load python" or similar commands. (The ones which list a CUDA version are only available if the appropriate CUDA module was loaded before the python module was loaded.)

Packages/modules for Python

The following table lists the various packages/modules/extensions for Python along with their version which are installed on the UMD HPC clusters, by cluster, Python version, and platform. These are the packages/modules/extensions which are enabled by default when you do the "module load python".
Python packages/modules/extensions enabled by default
Python Version3.10.103.10.103.10.103.10.103.10.103.10.103.8.123.8.12
Compilergcc/11.3.0gcc/11.3.0gcc/11.3.0gcc/11.3.0gcc/11.3.0gcc/11.3.0gcc/9.4.0gcc/9.4.0
CPU optimized forzen2icelakex86_64zen2icelakex86_64zen2zen2
CUDAnocudanocudanocudacuda/12.3.0cuda/12.3.0cuda/12.3.0nocudacuda/11.6.2
absl-py  1.4.0  1.4.00.13.00.13.0
aiohttp3.8.13.8.13.8.13.8.13.8.13.8.13.8.13.8.1
aiohttp-cors0.7.00.7.00.7.00.7.00.7.00.7.00.7.00.7.0
aiosignal1.2.01.2.01.2.01.2.01.2.01.2.01.2.01.2.0
alabaster0.7.130.7.130.7.130.7.130.7.130.7.13  
appdirs1.4.41.4.41.4.41.4.41.4.41.4.41.4.41.4.4
archspec0.2.20.2.20.2.20.2.20.2.20.2.2  
argon2-cffi21.3.021.3.021.3.021.3.021.3.021.3.021.3.021.3.0
argon2-cffi-bindings21.2.021.2.021.2.021.2.021.2.021.2.021.2.021.2.0
asdf2.15.02.15.02.15.02.15.02.15.02.15.02.4.22.4.2
asdf-standard1.0.31.0.31.0.31.0.31.0.31.0.3  
asdf-transform-schemas0.3.00.3.00.3.00.3.00.3.00.3.0  
asdf-unit-schemas0.1.00.1.00.1.00.1.00.1.00.1.0  
astropy5.1  5.1  4.0.1.post14.0.1.post1
asttokens2.2.12.2.12.2.12.2.12.2.12.2.1  
astunparse  1.6.31.6.31.6.31.6.3  
async-timeout4.0.24.0.24.0.24.0.24.0.24.0.24.0.24.0.2
attrs23.1.023.1.023.1.023.1.023.1.023.1.021.4.021.4.0
audioread2.1.82.1.82.1.82.1.82.1.82.1.82.1.82.1.8
Automat20.2.020.2.020.2.020.2.020.2.020.2.020.2.020.2.0
azure-common1.1.251.1.251.1.251.1.251.1.251.1.251.1.251.1.25
azure-core1.26.11.26.11.26.11.26.11.26.11.26.11.21.11.21.1
azure-storage-blob12.9.012.9.012.9.012.9.012.9.012.9.012.9.012.9.0
Babel2.12.12.12.12.12.12.12.12.12.12.12.12.9.12.9.1
backcall0.2.00.2.00.2.00.2.00.2.00.2.00.2.00.2.0
backports.entry-points-selectable1.1.11.1.11.1.11.1.11.1.11.1.1  
beautifulsoup44.12.24.12.24.12.24.12.24.12.24.12.24.10.04.10.0
beniget0.4.10.4.10.4.10.4.10.4.10.4.1  
bintrees2.0.72.0.72.0.72.0.72.0.72.0.72.0.72.0.7
biopython1.811.811.811.811.811.811.781.78
bleach6.0.06.0.06.0.06.0.06.0.06.0.04.1.04.1.0
blessed1.19.01.19.01.19.01.19.01.19.01.19.01.19.01.19.0
blinker1.41.41.41.41.41.41.41.4
boto31.26.261.26.261.26.261.26.261.26.261.26.261.18.121.18.12
botocore1.29.841.29.841.29.841.29.841.29.841.29.841.21.121.21.12
Bottleneck1.3.71.3.71.3.71.3.71.3.71.3.71.3.21.3.2
Brotli1.1.01.1.01.1.01.1.01.1.01.1.0  
brotlipy0.7.00.7.00.7.00.7.00.7.00.7.0  
build0.10.00.10.00.10.00.10.00.10.00.10.0  
cachetools5.2.05.2.05.2.05.2.05.2.05.2.04.2.44.2.4
calver2022.6.262022.6.262022.6.262022.6.262022.6.262022.6.26  
Cartopy0.22.0  0.22.0    
certifi2023.5.72023.5.72023.5.72023.5.72023.5.72023.5.72021.10.82021.10.8
cffi1.15.11.15.11.15.11.15.11.15.11.15.11.15.01.15.0
cftime1.0.3.41.0.3.41.0.3.41.0.3.41.0.3.41.0.3.41.0.3.41.0.3.4
chardet5.1.05.1.05.1.05.1.05.1.05.1.0  
charset-normalizer2.0.122.0.122.0.122.0.122.0.122.0.122.0.122.0.12
click8.1.38.1.38.1.38.1.38.1.38.1.38.0.38.0.3
cloudpickle2.2.02.2.02.2.02.2.02.2.02.2.01.6.01.6.0
cmyt1.1.21.1.21.1.21.1.21.1.21.1.21.1.21.1.2
colorama0.4.60.4.60.4.60.4.60.4.60.4.60.4.40.4.4
colorful0.5.40.5.40.5.40.5.40.5.40.5.40.5.40.5.4
colorspacious1.1.21.1.21.1.21.1.21.1.21.1.21.1.21.1.2
comm0.1.30.1.30.1.30.1.30.1.30.1.3  
constantly15.1.015.1.015.1.015.1.015.1.015.1.015.1.015.1.0
contourpy1.0.7 1.0.71.0.71.0.71.0.71.0.51.0.5
cppy1.2.11.2.11.2.11.2.11.2.11.2.1  
cryptography37.0.440.0.240.0.237.0.437.0.440.0.235.0.035.0.0
cssselect1.1.01.1.01.1.01.1.01.1.01.1.01.1.01.1.0
cutadapt4.44.44.44.44.44.42.102.10
cycler0.11.00.11.00.11.00.11.00.11.00.11.00.11.00.11.0
Cython0.29.360.29.360.29.360.29.360.29.360.29.360.29.240.29.24
dask2022.10.22022.10.22022.10.22022.10.22022.10.22022.10.22021.6.22021.6.2
dateutils0.6.120.6.120.6.120.6.120.6.120.6.12  
debugpy1.6.71.6.71.6.71.6.71.6.71.6.71.5.11.5.1
decorator5.1.15.1.15.1.15.1.15.1.15.1.15.1.15.1.1
defusedxml0.7.10.7.10.7.10.7.10.7.10.7.10.7.10.7.1
deprecation2.1.02.1.02.1.02.1.02.1.02.1.0  
dipy1.7.0  1.7.0    
distlib0.3.60.3.60.3.60.3.60.3.60.3.6  
distributed2022.10.22022.10.22022.10.22022.10.22022.10.22022.10.22021.6.22021.6.2
dmri-amico1.2.8  1.2.8    
dmri-commit1.4.4  1.4.4    
dnaio0.10.00.10.00.10.00.10.00.10.00.10.00.4.20.4.2
docutils0.190.190.190.190.190.190.180.18
ecos2.0.122.0.122.0.122.0.122.0.122.0.12  
editables0.30.30.30.30.30.3  
entrypoints0.40.40.40.40.40.40.40.4
envmodules0.10.10.10.10.10.10.10.1
exceptiongroup1.1.11.1.11.1.11.1.11.1.11.1.1  
executing1.1.01.1.01.1.01.1.01.1.01.1.0  
fasteners0.180.180.180.180.180.180.17.30.17.3
fastjsonschema2.16.32.16.32.16.32.16.32.16.32.16.32.15.12.15.1
fastrlock0.8.10.8.10.8.10.8.10.8.10.8.10.50.5
filelock3.12.03.12.03.12.03.12.03.12.03.12.03.5.03.5.0
flake86.0.06.0.06.0.06.0.06.0.06.0.04.0.14.0.1
flatbuffers23.5.2623.5.2623.5.2623.5.2623.5.2623.5.262022120720574520221207205745
flit3.7.13.7.13.7.13.7.13.7.13.7.1  
flit_core3.7.13.7.13.7.13.7.13.7.13.7.1  
fonttools4.37.34.37.34.37.34.37.34.37.34.37.3  
frozenlist1.3.11.3.11.3.11.3.11.3.11.3.11.3.01.3.0
fsspec2023.1.02023.1.02023.1.02023.1.02023.1.02023.1.02021.7.02021.7.0
future0.18.20.18.20.18.20.18.20.18.20.18.20.18.20.18.2
gast0.5.30.5.30.5.30.5.30.5.30.5.30.4.00.4.0
GDAL3.7.0  3.7.0    
gensim4.3.14.3.14.3.14.3.14.3.14.3.1  
gevent1.5.01.5.01.5.01.5.01.5.01.5.01.5.01.5.0
gmpy2      2.1.22.1.2
google3.0.03.0.03.0.03.0.03.0.03.0.0  
google-api-core1.14.21.14.21.14.21.14.21.14.21.14.21.14.21.14.2
google-auth1.6.31.6.32.20.01.6.31.6.32.20.01.6.31.6.3
google-auth-oauthlib0.5.20.5.20.5.20.5.20.5.20.5.20.4.60.4.6
google-cloud-core1.0.31.0.31.0.31.0.31.0.31.0.3  
google-cloud-storage1.18.01.18.01.18.01.18.01.18.01.18.0  
google-crc32c1.3.01.3.01.3.01.3.01.3.01.3.0  
google-pasta  0.2.0  0.2.0  
google-resumable-media2.4.12.4.12.4.12.4.12.4.12.4.1  
googleapis-common-protos1.58.01.58.01.58.01.58.01.58.01.58.01.55.01.55.0
gpustat      1.0.0b11.0.0b1
graphviz0.13.20.13.20.13.20.13.20.13.20.13.20.13.20.13.2
greenlet2.0.22.0.22.0.22.0.22.0.22.0.21.1.21.1.2
GridDataFormats1.0.11.0.11.0.11.0.11.0.11.0.10.5.00.5.0
grpcio1.52.01.52.01.52.01.52.01.52.01.52.01.32.01.32.0
gsd2.8.02.8.02.8.02.8.02.8.02.8.01.9.31.9.3
h5py3.8.0  3.8.0  3.6.03.6.0
hatchling1.14.01.14.01.14.01.14.01.14.01.14.0  
HeapDict1.0.11.0.11.0.11.0.11.0.11.0.11.0.11.0.1
html5lib1.11.11.11.11.11.11.11.1
hyperlink21.0.021.0.021.0.021.0.021.0.021.0.021.0.021.0.0
idna3.43.43.43.43.43.43.33.3
imageio2.30.02.30.02.30.02.30.02.30.02.30.02.10.32.10.3
imagesize1.4.11.4.11.4.11.4.11.4.11.4.1  
importlib-metadata6.6.06.6.06.6.06.6.06.6.06.6.04.11.14.11.1
importlib-resources5.12.05.12.05.12.05.12.05.12.05.12.05.3.05.3.0
incremental21.3.021.3.021.3.021.3.021.3.021.3.021.3.021.3.0
iniconfig2.0.02.0.02.0.02.0.02.0.02.0.00.0.00.0.0
ipykernel6.22.06.22.06.22.06.22.06.22.06.22.06.4.16.4.1
ipython8.11.08.11.08.11.08.11.08.11.08.11.07.23.17.23.1
ipython-genutils0.2.00.2.00.2.00.2.00.2.00.2.00.2.00.2.0
ipywidgets8.0.28.0.28.0.28.0.28.0.28.0.27.7.07.7.0
isal1.1.01.1.01.1.01.1.01.1.01.1.0  
isodate0.6.10.6.10.6.10.6.10.6.10.6.10.6.10.6.1
jax      0.2.250.2.25
jaxlib   0.4.3  0.1.740.1.74
jedi0.18.10.18.10.18.10.18.10.18.10.18.10.18.10.18.1
Jinja23.1.23.1.23.1.23.1.23.1.23.1.23.0.33.0.3
jmespath1.0.11.0.11.0.11.0.11.0.11.0.10.10.00.10.0
joblib1.2.01.2.01.2.01.2.01.2.01.2.01.1.01.1.0
jplephem2.92.92.92.92.92.92.92.9
jsonschema4.17.34.17.34.17.34.17.34.17.34.17.34.4.04.4.0
jupyter1.0.01.0.01.0.01.0.01.0.01.0.0  
jupyter-client7.1.27.1.27.1.27.1.27.1.27.1.27.0.67.0.6
jupyter-console6.4.46.4.46.4.46.4.46.4.46.4.4  
jupyter-contrib-core      0.4.20.4.2
jupyter-contrib-nbextensions      0.7.00.7.0
jupyter-core      4.7.14.7.1
jupyter-highlight-selected-word      0.2.00.2.0
jupyter-nbextensions-configurator      0.6.10.6.1
jupyter_core5.3.05.3.05.3.05.3.05.3.05.3.0  
jupyterlab-pygments0.2.20.2.20.2.20.2.20.2.20.2.20.1.20.1.2
jupyterlab-widgets3.0.33.0.33.0.33.0.33.0.33.0.31.1.01.1.0
Keras-Preprocessing1.1.21.1.21.1.21.1.21.1.21.1.2  
kiwisolver1.4.41.4.41.4.41.4.41.4.41.4.41.3.21.3.2
kwant      1.4.21.4.2
labmath      2.2.02.2.0
librosa      0.9.10.9.1
lightning-utilities   0.8.00.8.0   
llvmlite      0.37.00.37.0
locket1.0.01.0.01.0.01.0.01.0.01.0.00.2.00.2.0
lxml4.9.14.9.14.9.14.9.14.9.14.9.14.8.04.8.0
lz44.0.24.0.24.0.24.0.24.0.24.0.2  
m2r0.2.10.2.10.2.10.2.10.2.10.2.10.2.10.2.1
Mako1.2.21.2.21.2.21.2.21.2.21.2.21.1.61.1.6
Markdown3.4.13.4.13.4.13.4.13.4.13.4.13.3.43.3.4
MarkupSafe2.1.12.1.12.1.12.1.12.1.12.1.12.0.12.0.1
matlabengine      9.13.79.13.7
matplotlib3.8.2 3.8.23.8.23.8.23.8.23.4.33.4.3
matplotlib-inline0.1.60.1.60.1.60.1.60.1.60.1.60.1.30.1.3
mccabe0.7.00.7.00.7.00.7.00.7.00.7.00.6.10.6.1
MDAnalysis2.6.1 2.6.12.6.1 2.6.12.2.02.2.0
MDAnalysisTests      2.2.02.2.0
mercurial6.4.56.4.56.4.56.4.56.4.56.4.5  
meson1.1.01.1.01.1.01.1.01.1.01.1.0  
meson-python0.12.00.12.00.12.00.12.00.12.00.12.0  
mistune0.8.40.8.40.8.40.8.40.8.40.8.40.8.40.8.4
mmtf-python1.1.2 1.1.21.1.2 1.1.21.1.21.1.2
mock4.0.34.0.34.0.34.0.34.0.34.0.34.0.34.0.3
modred2.0.4.post62.0.4.post62.0.4.post62.0.4.post62.0.4.post62.0.4.post6  
more-itertools9.1.09.1.09.1.09.1.09.1.09.1.08.12.08.12.0
mpi4py3.1.4 3.1.43.1.43.1.43.1.43.1.23.1.2
mpmath1.2.11.2.11.2.11.2.11.2.11.2.11.2.11.2.1
mrcfile1.3.01.3.01.3.01.3.01.3.01.3.0  
msgpack1.0.41.0.41.0.41.0.41.0.41.0.41.0.21.0.2
msrest0.6.210.6.210.6.210.6.210.6.210.6.210.6.210.6.21
multidict6.0.26.0.26.0.26.0.26.0.26.0.26.0.26.0.2
nbclient0.7.20.7.20.7.20.7.20.7.20.7.20.5.50.5.5
nbconvert6.5.16.5.16.5.16.5.16.5.16.5.16.5.06.5.0
nbformat5.8.05.8.05.8.05.8.05.8.05.8.05.4.05.4.0
nest-asyncio1.5.61.5.61.5.61.5.61.5.61.5.61.5.41.5.4
netCDF4      1.5.31.5.3
networkx2.8.62.8.62.8.62.8.62.8.62.8.62.7.12.7.1
nibabel4.0.24.0.24.0.24.0.24.0.24.0.23.2.13.2.1
nltk3.8.13.8.13.8.13.8.13.8.13.8.1  
notebook6.4.126.4.126.4.126.4.126.4.126.4.126.4.116.4.11
numba      0.54.00.54.0
numexpr2.8.32.8.32.8.32.8.32.8.32.8.32.8.32.8.3
numpy1.26.21.26.21.26.21.26.21.26.21.26.21.19.51.19.5
nvidia-ml-py3      7.352.07.352.0
oauthlib3.1.03.1.03.1.03.1.03.1.03.1.03.1.13.1.1
opencensus0.7.100.7.100.7.100.7.100.7.100.7.10  
opencensus-context0.1.10.1.10.1.10.1.10.1.10.1.10.1.10.1.1
OpenMM   7.7.07.7.0   
opt-einsum3.3.03.3.03.3.03.3.03.3.03.3.03.3.03.3.0
optax      0.1.40.1.4
OWSLib0.25.0  0.25.0    
packaging23.023.023.023.023.023.021.021.0
pandas1.5.31.5.31.5.31.5.31.5.31.5.31.3.41.3.4
pandocfilters1.5.01.5.01.5.01.5.01.5.01.5.01.5.01.5.0
parso0.8.30.8.30.8.30.8.30.8.30.8.30.8.20.8.2
partd1.4.01.4.01.4.01.4.01.4.01.4.01.1.01.1.0
pathspec0.11.10.11.10.11.10.11.10.11.10.11.1  
patsy0.5.20.5.20.5.20.5.20.5.20.5.20.5.10.5.1
pep5170.12.00.12.00.12.00.12.00.12.00.12.0  
petsc4py      3.16.63.16.6
pexpect4.8.04.8.04.8.04.8.04.8.04.8.04.8.04.8.0
physics-tenpy1.0.1  1.0.1    
pickleshare0.7.50.7.50.7.50.7.50.7.50.7.50.7.50.7.5
Pillow9.5.09.5.09.5.09.5.09.5.09.5.08.4.08.4.0
pip23.023.023.023.023.023.021.1.121.1.1
pkgconfig1.5.51.5.51.5.51.5.51.5.51.5.5  
platformdirs3.5.03.5.03.5.03.5.03.5.03.5.0  
pluggy1.0.01.0.01.0.01.0.01.0.01.0.01.0.01.0.0
ply3.113.113.113.113.113.11  
poetry-core1.2.01.2.01.2.01.2.01.2.01.2.0  
pooch      1.5.21.5.2
prometheus-client0.14.10.14.10.14.10.14.10.14.10.14.10.12.00.12.0
prompt-toolkit3.0.313.0.313.0.313.0.313.0.313.0.313.0.293.0.29
protobuf4.24.34.24.34.24.33.17.33.17.34.24.33.18.13.18.1
psutil5.9.45.9.45.9.45.9.45.9.45.9.45.8.05.8.0
ptyprocess0.7.00.7.00.7.00.7.00.7.00.7.00.7.00.7.0
pure-eval0.2.20.2.20.2.20.2.20.2.20.2.2  
py1.11.01.11.01.11.01.11.01.11.01.11.01.11.01.11.0
pyaml      21.8.321.8.3
pyarrow10.0.1  10.0.110.0.1   
pyasn10.4.80.4.80.4.80.4.80.4.80.4.80.4.80.4.8
pyasn1-modules0.2.80.2.80.2.80.2.80.2.80.2.80.2.80.2.8
pybind112.10.12.10.12.10.12.10.12.10.12.10.12.6.22.6.2
pycodestyle2.10.02.10.02.10.02.10.02.10.02.10.02.8.02.8.0
pycparser2.212.212.212.212.212.212.202.20
pycuda      2021.12021.1
pyDeprecate      0.3.10.3.1
pydicom2.3.02.3.02.3.02.3.02.3.02.3.0  
pydot1.4.21.4.21.4.21.4.21.4.21.4.2  
pyerfa2.0.0.1  2.0.0.1    
pyFFTW0.12.00.12.00.12.00.12.00.12.00.12.0  
pyflakes3.0.13.0.13.0.13.0.13.0.13.0.12.4.02.4.0
Pygments2.13.02.13.02.13.02.13.02.13.02.13.02.10.02.10.0
pygraphviz1.101.101.101.101.101.10  
PyJWT2.4.02.4.02.4.02.4.02.4.02.4.02.1.02.1.0
PyMUMPS0.3.2 0.3.20.3.2 0.3.20.3.20.3.2
pyOpenSSL19.0.019.0.019.0.019.0.019.0.019.0.0  
pyparsing3.0.93.0.93.0.93.0.93.0.93.0.92.4.72.4.7
pyproj3.6.1  3.6.1    
pyproject-metadata0.7.10.7.10.7.10.7.10.7.10.7.1  
pyproject_hooks1.0.01.0.01.0.01.0.01.0.01.0.0  
PyQt55.15.95.15.95.15.95.15.95.15.95.15.95.13.15.13.1
PyQt5-sip12.12.112.12.112.12.112.12.112.12.112.12.1  
pyrsistent0.19.30.19.30.19.30.19.30.19.30.19.30.18.00.18.0
pyshp2.1.02.1.02.1.02.1.02.1.02.1.0  
PySocks1.7.11.7.11.7.11.7.11.7.11.7.11.7.11.7.1
pytest7.3.2 7.3.27.3.2 7.3.26.2.56.2.5
pytest-runner6.0.06.0.06.0.06.0.06.0.06.0.0  
python-dateutil2.8.22.8.22.8.22.8.22.8.22.8.22.8.22.8.2
pythran0.12.00.12.00.12.00.12.00.12.00.12.0  
pytools      2021.2.92021.2.9
pytorch-lightning   2.0.02.0.0   
pytz2022.2.12022.2.12022.2.12022.2.12022.2.12022.2.12021.32021.3
PyWavelets1.4.11.4.11.4.11.4.11.4.11.4.11.1.11.1.1
PyYAML6.06.06.06.06.06.06.06.0
pyzmq25.0.225.0.225.0.225.0.225.0.225.0.222.3.022.3.0
QScintilla      2.11.62.11.6
qsymm1.2.71.2.71.2.71.2.71.2.71.2.7  
qtconsole5.2.05.2.05.2.05.2.05.2.05.2.05.2.05.2.0
QtPy1.11.21.11.21.11.21.11.21.11.21.11.2  
regex2022.8.172022.8.172022.8.172022.8.172022.8.172022.8.172020.11.132020.11.13
reportlab4.0.44.0.44.0.44.0.44.0.44.0.4  
requests2.28.22.28.22.28.22.28.22.28.22.28.22.26.02.26.0
requests-oauthlib1.3.11.3.11.3.11.3.11.3.11.3.11.3.01.3.0
resampy      0.2.20.2.2
rsa4.94.94.94.94.94.94.7.24.7.2
rst2pdf0.1000.1000.1000.1000.1000.100  
s3transfer0.6.00.6.00.6.00.6.00.6.00.6.00.5.00.5.0
scikit-image      0.18.30.18.3
scikit-learn1.2.21.2.21.2.21.2.21.2.21.2.21.0.11.0.1
SciPy      1.7.11.7.1
scipy1.10.11.10.11.10.11.10.11.10.11.10.1  
seaborn0.12.2 0.12.20.12.2 0.12.20.11.20.11.2
semantic-version2.10.02.10.02.10.02.10.02.10.02.10.02.8.22.8.2
Send2Trash1.8.01.8.01.8.01.8.01.8.01.8.01.8.01.8.0
setproctitle      1.1.101.1.10
setuptools63.4.364.0.063.4.368.0.068.0.063.4.362.3.262.3.2
setuptools-rust1.5.11.5.11.5.11.5.11.5.11.5.10.12.10.12.1
setuptools-scm7.0.57.0.57.0.57.0.57.0.57.0.5  
shapely2.0.2 2.0.22.0.2 2.0.2  
sip6.7.96.7.96.7.96.7.96.7.96.7.9  
six1.16.01.16.01.16.01.16.01.16.01.16.01.16.01.16.0
slepc4py      3.16.33.16.3
smart-open5.2.15.2.15.2.15.2.15.2.15.2.1  
smartypants2.0.12.0.12.0.12.0.12.0.12.0.1  
snowballstemmer2.2.02.2.02.2.02.2.02.2.02.2.02.0.02.0.0
sortedcontainers2.1.02.1.02.1.02.1.02.1.02.1.02.1.02.1.0
soundfile0.11.00.11.00.11.00.11.00.11.00.11.00.11.00.11.0
soupsieve2.3.2.post12.3.2.post12.3.2.post12.3.2.post12.3.2.post12.3.2.post12.2.12.2.1
spams2.6.2.5  2.6.2.5  2.6.2.52.6.2.5
Sphinx7.0.17.0.17.0.17.0.17.0.17.0.1  
sphinxcontrib-applehelp1.0.21.0.21.0.21.0.21.0.21.0.2  
sphinxcontrib-devhelp1.0.21.0.21.0.21.0.21.0.21.0.2  
sphinxcontrib-htmlhelp2.0.02.0.02.0.02.0.02.0.02.0.0  
sphinxcontrib-jsmath1.0.11.0.11.0.11.0.11.0.11.0.1  
sphinxcontrib-programoutput0.150.150.150.150.150.15  
sphinxcontrib-qthelp1.0.31.0.31.0.31.0.31.0.31.0.3  
sphinxcontrib-serializinghtml1.1.51.1.51.1.51.1.51.1.51.1.5  
stack-data0.5.00.5.00.5.00.5.00.5.00.5.0  
statsmodels0.13.20.13.20.13.20.13.20.13.20.13.20.12.20.12.2
sympy1.11.11.11.11.11.11.11.11.11.11.11.11.81.8
tables3.7.03.7.03.7.03.7.03.7.03.7.03.6.13.6.1
tabulate      0.8.90.8.9
tblib1.6.01.6.01.6.01.6.01.6.01.6.01.6.01.6.0
tensorboard      2.7.02.7.0
tensorboard-data-server      0.6.10.6.1
tensorboard-plugin-wit1.8.11.8.11.8.11.8.11.8.11.8.11.8.01.8.0
tensorboardX      2.5.12.5.1
termcolor  1.1.0  1.1.0  
terminado0.12.10.12.10.12.10.12.10.12.10.12.10.12.10.12.1
testpath0.6.00.6.00.6.00.6.00.6.00.6.0  
threadpoolctl3.1.03.1.03.1.03.1.03.1.03.1.03.0.03.0.0
tidynamics1.1.2 1.1.21.1.2 1.1.2  
tifffile      2021.11.22021.11.2
tinyarray1.2.41.2.41.2.41.2.41.2.41.2.41.2.31.2.3
tinycss21.1.11.1.11.1.11.1.11.1.11.1.11.1.11.1.1
tinycudann      1.61.6
toml0.10.20.10.20.10.20.10.20.10.20.10.20.10.20.10.2
tomli2.0.12.0.12.0.12.0.12.0.12.0.11.2.11.2.1
tomli-w      1.0.01.0.0
tomli_w1.0.01.0.01.0.01.0.01.0.01.0.0  
tomlkit0.11.40.11.40.11.40.11.40.11.40.11.4  
toolz0.12.00.12.00.12.00.12.00.12.00.12.00.9.00.9.0
torch   2.0.12.0.1  1.11.0
torchaudio   2.0.2+31de77d2.0.2  0.11.0
torchmetrics   0.11.40.11.4  0.7.0
torchsummary   1.5.11.5.1  1.5.1
torchvision   0.15.20.15.2  0.12.0a0
tornado6.16.16.16.16.16.16.16.1
tqdm4.65.04.65.04.65.04.65.04.65.04.65.04.62.34.62.3
traitlets5.9.05.9.05.9.05.9.05.9.05.9.05.1.15.1.1
trove-classifiers2023.3.92023.3.92023.3.92023.3.92023.3.92023.3.9  
Twisted21.7.021.7.021.7.021.7.021.7.021.7.021.7.021.7.0
typing-extensions      4.1.14.1.1
typing_extensions4.5.04.5.04.5.04.5.04.5.04.5.0  
unyt2.9.2  2.9.2  2.9.22.9.2
urllib31.26.121.26.121.26.121.26.121.26.121.26.121.26.61.26.6
urllib3-secure-extra0.1.00.1.00.1.00.1.00.1.00.1.0  
virtualenv20.22.020.22.020.22.020.22.020.22.020.22.0  
voluptuous      0.11.70.11.7
wcwidth0.2.50.2.50.2.50.2.50.2.50.2.50.2.50.2.5
webencodings0.5.10.5.10.5.10.5.10.5.10.5.10.5.10.5.1
Werkzeug  3.0.0  3.0.02.0.22.0.2
wheel0.37.10.37.10.37.10.37.10.37.10.37.1  
widgetsnbextension4.0.34.0.34.0.34.0.34.0.34.0.33.6.03.6.0
wrapt  1.14.1  1.14.1  
xgboost      1.5.21.5.2
xopen1.6.01.6.01.6.01.6.01.6.01.6.00.8.40.8.4
yapf0.30.0  0.30.0    
yarl1.8.11.8.11.8.11.8.11.8.11.8.11.7.21.7.2
yt4.1.2  4.1.2  4.1.24.1.2
zict3.0.03.0.03.0.03.0.03.0.03.0.01.0.01.0.0
zipp3.8.13.8.13.8.13.8.13.8.13.8.13.6.03.6.0
zope.interface5.4.05.4.05.4.05.4.05.4.05.4.05.4.05.4.0

In addition, a number of other packages, C libraries, applications, etc. provide a Python API, etc. through a module. As these package are more than just Python modules, and indeed in many cases most users of the package are not accessing the Python modules they define, these packages have their own modulefiles. Generally, you can access these by loading their corresponding modulefiles before starting python (normally it should not matter whether you load the package module before or after loading python). These packages are:

Packages defining a Python Module

This section lists various software packages containing python modules which can be imported in your python code, after the corresponding environmental module is loaded.

Packages defining a Python Module
Package Name Description Supported CPUs GPU ready?
charm4py Charm4py: distributed/parallel programing framework for Python zen, zen2 Yes
charmm charmm: Chemistry at HARvard Macromolecular Mechanics. zen2 Yes
cupy cupy: a Python array library accelerated with NVIDIA CUDA zen2 Yes
cython cython: Compiler for writing C extensions for Python icelake, x86_64, zen, zen2
jupyter jupyter: The Jupyter Notebook application icelake, x86_64, zen, zen2
magics magics: meteorological plotting software icelake, zen2 Yes
openmm openmm: A high-performance toolkit for molecular simulation. icelake, zen2 Yes
pyray pyray: Framework for scaling AI and Python applications zen2
pytorch pytorch: Open-source machine learning library icelake, zen2 Yes
tensorflow tensorflow: Open-source software library for machine intelligence icelake, zen, zen2 Yes
trilinos Trilinos: Solvers collection including linear, non-linear, optimization, and transient solvers zen2

Installing modules

Python's capabilities can be significantly enhanced through the addition of modules. Code can import a module to enable its functionality.

The supported python interpretters on the system have a selection of modules preinstalled. If a module you are interested in is not in that list, you can either install a personal copy of the module for yourself, or request that it be installed site wide. We will make reasonable efforts to accomodate such requests as staffing resources allow.

Installing modules yourself

  1. Using setup.py
  2. Using virtual environments and pip
  3. Using conda

The mechanism for installing a module is of course dependent on the module being installed, but most modern python modules support the setup.py mechanism described below. But many packages will support installing via pip and virtual environments as well, and that is typically easier.

Installing python modules using setup.py

Note: Users might wish to look at Installing python modules using virtual environments first, as that is often easier.

The standard procedure for installing your own copy of a module is:

  1. module load python/X.Y.Z to select the version of python you wish to use.
  2. Create a directory to contain your python module, if not already done. Typically, you will want one directory to house all of the modules you are installing, so something like mkdir ~/.mypython will work. You should also create lib and lib/python directories beneath it, e.g. mkdir ~/.mypython/lib ~/.mypython/lib/python.
  3. You will need to tell python where to look for your modules. Assuming you are putting your modules under ~/.mypython, something like setenv PYTHONPATH ~/.mypython/lib/python (bash/bourne shell users should do PYTHONPATH=~/.mypython/lib/python; export PYTHONPATH ). You probably want to add this to your .cshrc.mine or .bashrc.mine.
  4. Download and unzip/untar/etc the module sources. Cd to the main module source directory (it should contain the file setup.py
  5. Run python setup.py install --home ~/.mypython

If all goes well, the module should now be installed under ~/.mypython or wherever you specified. If there are executables associated with it, they should be in ~/.mypython/bin. You should be able to import the module in python now (this assumes that PYTHONPATH is set as indicated above).

Of course, not all modules install easily. Unfortunately, the install process can fail in far too many ways than can be reasonably enumerated. If you are comfortable with building modules, you might find reasonable guidance from error messages to assist you in getting the module to build, but it is probably easiest to just request the module be installed to the system libraries.

Installing modules yourself using virtual environments

Although the standard procedure described above works for most cases, there are cases where more separation is required. Python3 includes a venv module which allows you to create a fully independent virtual python environment, copying the python executables and standard and system libraries to your own directory, and allowing you to add/update/delete from there. This has the advantage that the virtualenv is almost completely isolated; so changes made in the system installation of python are unlikely to impact your virtualenv. This can be important if you have a code or application which requires e.g. version 1.6 of the foo package, but will break if it is upgraded to 1.7 (it appears that when using standard scheme above using PYTHONPATH, the system library directories are ALWAYS searched before PYTHONPATH, meaning that method can be used to add modules, but not to upgrade or downgrade modules).

However, the virtualenv takes up a significant amount of diskspace, and the isolation from the system python can be a negative as well as upgrades and/or new modules added to the system python will NOT be visible --- this is good when as in the example above it breaks something, but most of the time the upgrades are desirable.

To install a package with the virtualenv mechanism, you must first create a virtual python environment.

  1. module load python/X.Y.Z to select the version of python you wish to use in this virtual environment.
  2. You should select a directory where the virtual python environment should live. Each virtual environment you create will be a subdirectory of this directory. For the examples below, we will use the my-venv subdirectory of your home directory (e.g. ~/my-venv).
  3. For python3, you can create a virtual env with either of the simple commands:
    1. python -mvenv --system-site-packages ~/my-venv: This variant will give the virtual environment access to system installed python packages, e.g. numpy, scipy and matplotlib. This is the easiest version, but as it is less isolated from the system python installation it can lead to problems if there are version compatibility issues.
    2. python -mvenv ~/my-venv: This variant will isolate the resulting environment from system packages. This is the safest approach, but may require you to install packages available on the system, and can be trickier in some cases.
  4. For python2, you need to create the empty directory (mkdir ~/my-venv), and then unset the PYTHONHOME variable set by the module load command (i.e. unsetenv PYTHONHOME for the csh and tcsh shells, and unset PYTHONHOME for bash). Then issue either of the following commands:
    1. virtualenv --system-site-packages ~/my-venv
    2. virtualenv ~/my-venv
    The first version, with the --system-site-packages flag, behaves like the python3 version with the same flag --- the system packages are still available. The second version isolates your virutal environment from the system packages.
  5. In order to use this virtual python (for either python version) environment, you must first activate it. This must be done in every process using the virtual environment. You do this by issue one of the following commands:
    1. source ~/venv/bin/activate.csh for csh or tcsh shells
    2. source ~/venv/bin/activate for bash shells
  6. When you are finished with the environment, the command deactivate will deactivate the virtual environment.

Once the virtual environment is created and activated, installation is usually relatively simple using the pip command. You should just be able to do pip install NameOfPackage. Pip should take care of downloading the package and installing it for you.

Of course, not all modules install easily. Unfortunately, the install process can fail in far too many ways than can be reasonably enumerated. If you are comfortable with building modules, you might find reasonable guidance from error messages to assist you in getting the module to build, but it is probably easiest to just request the module be installed to the system libraries.

Installing modules yourself using conda

NOTE: We generally recommend that you try installing your own Python packages using one of the methods above, i.e. either using setup.py or using the venv module and virtual environments rather than using conda.

Conda is another option for installing python and other packages, but it does even more separation and isolation than the venv method. This can either be an advantage or a liability depending on the use case. This isolation means that you are not constrained but what system staff have installed on the cluster, but it also means it is very difficult if not impossible to take advantage of any packages system staff have installed on the cluster. Also, since you are relying on an entire environment which you installed, the ability of HPC staff to provide assistance should there be issues is limited. Therefore, we encourage users to try one of the other methods if such is feasible.

NOTE:The Anaconda distribution of Python and R is restrictively licensed. The Anaconda company states that the use of Anaconda's offerings at an organization of more than 200 employees requires a Business or Enterprise license. As the Univesity of Maryland does not have such a license, the use of the anaconda distribution or its repositories at UMD (outside of use in a formally scheduled curriculum based course) is not free and is not allowed, even though Anaconda is not currently blocking such accesses via technological means. I.e., the fact that your conda installation commands succeed does not mean that your use of the command is consistent with the Anaconda company's terms of use. See e.g. the Anaconda blog for more information regarding Anaconda licensing.

Due to the license restrictions above, we encourage users to use the miniforge/mambaforge installer which pulls packages from the conda-forge repository, which is not covered by the restrictive Anaconda license and is free to use. (You still may need to check for any This provides similar functionality to miniconda without the license restrictions.

Miniconda is a subset of Anaconda, without some extras like Anaconda Navigator, etc. By default, it pulls packages from the default Anaconda repositories, which requires licensing from Anaconda. The actual conda program which installs packages is free to use, but only if you are downloading packages from repositories which are free to use. If you insist on using miniconda, please be sure to remove the default channel (as well as any subchannels of the default channel) as these are restrictively licensed and require licesnses, and replace it with conda-forge channel, e.g.

conda config --show channels
conda config --remove channels defaults
# You might also need to remove subchannels like ananconda, main, r, pro, etc

conda config --add channels conda-forge

But we encourage you to use miniforge/mambaforge instead.

To install python packages using conda, you should usually follow a process like outlined below:

  1. If you have not already done so, install a copy of mambaforge/miniforge or similar, as follows:
    1. Choose a location for your conda environments. Because conda environments potentially can get quite large, a subdirectory of your scratch directory is usually best. E.g. ~/scratch/condaroot. Create that directory if it does not already exist.
    2. Download Mambaforge from https://conda-forge.org/miniforge into your condaroot directory.
    3. Make a copy of your initialization dot files, e.g. cp ~/.bashrc ~/.bashrc.HOLD. You might wish to do similar for .cshrc and other init dot files if they exist.
    4. Install miniforge/mambaforge, cd ~/scratch/condaroot; bash Mambaforge-X.Y.Z-A-Linux-s86_64.sh -p mambaforge-X.Y.z This will install mambaforge to the mabaforge-X.Y.Z subdirectory of the directory you ran the script from (~/scratch/condaroot). The script will ask some questions, ansering yes to all should generally work.
    5. The script will have updated your ~/.bashrc and possibly some other dot files. Although you can leave things like that, in which case conda will be initialized in every shell whether it needs it or not (and potentially causing delays in shell startup), we recommend that you copy the modifications made to the initialization scripts to a conda specific script (e.g. cp ~/.bashrc ~/bashrc.conda; cp ~/.bashrc.HOLD ~/.bashrc and edit the new ~/bashrc.conda to remove the lines before the # >>> conda initialize >>> line. You can then source this file whenever you wish to use conda.
  2. Initialize conda if needed. If you followed the instructions to remove the conda initialization from your initialization dot files, you should initialize conda with something like source ~/bashrc.conda.
  3. If you do not already have a conda environment you are working in, create one. You should generally have a separate environment for each project and/or major software package you intend to use. To create an environment, do something like: cd ~/scratch/condaroot; conda create -n myenv This will create a conda environment myenv; we recommend you choose a more meaningful name.
  4. Activate your conda environment. E.g. conda activate myenv, replacing myenv with the name of the environment to activate.
  5. If this is a new miniforge environment, you will need to install pip. Do conda install pip.
  6. If this is a previously created package, or a miniforge environment, you should update pip. Do pip install --upgrade pip
  7. Install your python packages. The exact procedure may vary a bit depending on the package, but usually it is something like pip install PACKAGE_NAMNE.
`

Assorted Tips and Tricks

Matplotlib Tricks


Numba and GPU Support

The most recent versions of Python installed (e.g. 3.5.1) provide a python module called "numba". Numba allows for certain portions of python code to be compiled to a lower-level machine code to improve performance, in many cases simply by adding the directive "@jit" before the function to compile. Depending on the function, one might achieve order of magnitude sized performance gains. E.g. (example taken from wikipedia)

from numba import jit
@jit
def sum1d(my_array):
        total = 0.0
        for i in range(my_array.shape[0])
                total += my_array[i]
        return total

Here, the addition of the "@jit" (for just-in-time compilation) can result in code running 100-200 times faster than the original on a long Numpy array, and up to 30% faster than Numpy's builtin "sum()" function, on standard CPU cores.

Some codes can perform even better on GPUs, and Numba can make this fairly simple by importing "cuda" from numba and using "cuda.jit" in place of "jit". There are constraints imposed when using GPUs, so not every code can be easily converted for GPU use.

To use Numba with GPUs on the Deepthought clusters, you will need to

  1. Request a GPU-enabled node
  2. Load an appropriate version of CUDA. Currently, cuda/7.0.28 or cuda/7.5.18 will work with Numba.

The details of using Numba, and especially using Numba with CUDA, is well beyond the scope of this document. Some useful links for more information are:

Using python with MPI

If you wish to take advantage of the multiple cores and even many nodes available on High Performance Computing (HPC) clusters, it is useful to use the Message Passing Interface (MPI) for coordinate and communicate among the various processes, a standard and ubiquitous programming methodology for distributed memory parallelism.

There is a package mpi4py available on all Pythons installed system-wide on the Deepthought clusters which basically makes the various MPI calls available to python code. Because mpi4py basically mimics the function calls in the standard MPI library/API, it makes the task of transcribing algorithms from python to/from C much easier.

When you have python code (e.g. my-mpi4py-script.py) designed to use MPI via mpi4py, you will normally wish to execute the python code using the mpirun command. It is important that you use the mpirun command from the SAME MPI library as was used to build mpi4py for the python version you are running --- typically this will mean using module load to load the correct gcc compiler and openmpi version as used in building the python interpretter and modules, as listed in the version information table at the top of this document. E.g., a job submission script to launch my-mpi4py-script.py on 40 cores using python/3.5.1 might look like:

#!/bin/bash
#Assume will be finished in no more than 8 hours
#SBATCH -t 8:00:00
#Launch on 40 cores distributed over as many nodes as needed
#SBATCH -n 40
#Assume need 6 GB/core (6144 MB/core)
#SBATCH --mem-per-core=6144

#Make sure module cmd gets defined
. ~/.profile

#Load required modules
module load python/3.5.1
#Load correct gcc (4.9.3) and mpi (openmpi/1.8.6) for python/3.5.1
module load gcc/4.9.3
module load openmpi/1.8.6

#Normally do not need to give -n 40, as openmpi will determine from Slurm
#environment variables
mpirun mp-mpi4py-script.py

Although exploring mpi4py is beyond the scope of this document, we do provide some on-line tutorials, etc., to help if you wish to explore mpi4py further:





Back to Top