- The default Python with Rocky 8.x is version 3.6.8;
- so unless you load a specific module, you will run these versions of Python.
Additional versions of Python are available as follows:
Module Version Comment none 3.6.8 pythonunder Rocky 8.10none 2.7.18 python2under Rocky 8.10python33.9.18 BCM version python393.9.18 BCM version tools/python3.11.4 :: Anaconda, Inc. current default tools/python/2.72.7.16 :: Anaconda, Inc. tools/python/3.73.7.3 :: Anaconda, Inc. Anaconda built/full support tools/python/3.83.8.8 :: Anaconda, Inc. Anaconda built/full support tools/python/3.93.9.8 Built from source tools/python/3.9a3.9.13 Built from source tools/python/3.103.10.0 Built from source tools/python/3.113.11.4 :: Anaconda, Inc. Anaconda built/full support tools/python/3.11b3.11.7 :: Anaconda, Inc. Anaconda built/full support tools/python/3.133.13.5 :: Anaconda, Inc. Anaconda built/full support tools/python/3.143.14.0 Built from source intel/python3.9.7 :: Intel Corporation Intel's version intel/python/37-21.43.7.11 :: Intel(R) Corporation Intel's version w/ 21.4 intel/python/393.9.7 :: Intel(R) Corporation Intel's version intel/python/39-22.13.9.7 :: Intel(R) Corporation Intel's version w/ 22.1 intel/python/39-23.13.9.26 :: Intel(R) Corporation Intel's version w/ 23.1 intel/python/39-24.03.9.18 :: Intel(R) Corporation Intel's version w/24.0 conda/25.9.13.11.14 Intel's version w/ 25.3 conda/25.9.13.12.12 Intel's version w/ 25.3 - Intel is now distributing Python via
conda(see this page)- You can also access it via the
intel_python_311orintel_python_312environments after loadingconda/25.9.1
- You can also access it via the
If you are looking for the versions with all the usual packages, use the
tools/python one. This list will vary as we install new versions.
Package Installation and Management
We have installed a long list of packages with the Anaconda versions.
You can view that list with (after loading the appropriate module)
% module load tools/python
% pip list
You can install additional packages without elevated (admin/root) privileges with
% pip install --user <package-name>
Alternatively you can use conda to manage your Python packages and beyond that manage your environment - rather than using module files.
- If you only need a handful of packages that have no incompatibilities with the ones already installed and
- you can use one of the available python version you may chose not to bother with
conda,and usepip install --user. - For further explanations on Anaconda and Miniconda and instructions on using
conda, consult the Conda: Anaconda & Miniconda page.
Python Multi-Threading (NUMPY and others)
- By default,
NUMPY,as well as other packages, are built to use multi-threading, namely some numerical operations will use all the available CPUs on the node it is running on.This is NOT the way to use a shared resource, like Hydra,
- The symptom is that your job is oversubscribed.
The solution is to tell
pythonhow many threads to use, using the respective module:serial casemodule load tools/python/use-single-thread
or
multi-thread casemodule load tools/python/use-multi-thread
use
module show <module-name>to see what is done, the multi-thread version will use the value stored in the environment variable NSLOTS to match the requested resource (-pe mthread).
If you distribute your python code with mpi, use the single thread version.
You can use
tools/python-single-thread-numpyortools/single-thread-numpyinstead oftools/python/use-single-thread
and
tools/python-mthread-numpyortools/mthread-numpyinstead oftools/python/use-multi-thread
for backward compatibility.
Example
# # this example uses 4 threads #$ -pe mthread 4 #$ -cwd -j y -o demo-mthread-numpy.log -N demo-mthread-numpy # echo + `date` $JOB_NAME started on $HOSTNAME in $QUEUE with id=$JOB_ID echo NSLOTS = $NSLOTS # module load tools/python/3.8 module load tools/python/use-multi-thread python my-big-data-cruncher.py # echo = `date` $JOB_NAME done.
Last update SGK/MPK