Skip to content

A new version of SD Connect and SD Desktop will be available from Monday, September 28. The major upgrade will introduce significant improvements, but also includes changes that are not compatible with the current version of the service. Click here to review the available support materials.

Warning!

Puhti and Mahti computing services have been decommissioned and no new jobs are accepted or executed on its compute nodes. Puhti and Mahti login nodes and storage services are planned to remain available until 15 October 2026. Clean up unnecessary files and move any data you need to keep by 31 August 2026. See the Roihu data migration guide for instructions on transferring your data to Roihu.

Python

Python is a general-purpose high-level programming language that is widely used for scientific computing. For instructions on using Python effectively on CSC supercomputers, please see our Python usage guide.

Available

  • Roihu: 3.x. versions

License

Python packages are usually licensed under various free and open source (FOSS) licenses. Python itself is licensed under the PSF License, which is also open source.

Usage

Our Python usage guide contains instructions for installing packages, using different development environments and doing parallel processing with Python.

It is generally recommended to use one of pre-installed Python environments for computing, since these already contain the essential libraries for most uses. If for some reason one wishes to use Python without loading an environment module, a basic system Python is also available.

System Python

If using a pre-installed environment is not suitable, the basic system Python 3.9 in Roihu can be launched with:

python

Pre-installed Python environments

Roihu has several pre-installed environment modules containing Python environments made for different science areas.

In Roihu:

Module name Purpose Roihu-CPU/Roihu-GPU
python-geo geoinformatics CPU
python-data data analysis and ML utilities CPU/GPU
python-pytorch PyTorch ML framework CPU/GPU
python-vllm LLM inference GPU
python-tensorflow Tensorflow ML framework CPU/GPU
python-jax JAX ML framework GPU

To use any of the above environments, simply load the corresponding module using the module load command.

module load <MODULE_NAME>  # e.g. module load python-data

To see the Python libraries included in a module, you can run the following line. The -s option excludes packages installed by the user.

python3 -sm pip list

Typically, after activating a Python-based module, the python3 command points to a version of Python that is newer than the default system Python and has a wider set of available packages. You can always check the Python version with the command python3 --version, and the full path of the command with which python3 (to see if you are using the system Python or one from the modules listed above).

Note that most of the pre-installed Python environment modules are self-contained and mutually exclusive environments, so it does not make sense to for example load both python-data and python-pytorch modules. The module loaded last will be the only active one, and the module load command will warn about this, for example in Roihu:

Lmod is automatically replacing "python-data/3.12-31.03" with "python-pytorch/2.10".

Custom Python environments

While the pre-installed Python environments suffice for many applications, projects often involve tasks which require additional libraries. The following options are available in this case:

References

More information