Using packages
Learning outcomes
Practice using the documentation of your HPC cluster
Can find and load a Python package module
Can determine if a Python package is installed
Why Python packages are important
Python packages are pieces of tested Python code. Prefer using a Python package over writing your own code.
Why software modules are important
Software modules allows users of any HPC cluster to activate their favorite software of any version. This helps to assure reproducible research.
How to see which Python packages are installed
There are two ways to determine which Python packages are installed:
Where |
Command to run |
The package is present when … |
|---|---|---|
On the command-line |
|
It shows up in the list |
In the Python interpreter |
|
There is no error |
Exercises
Want to see the answers as a video?
Some HPC clusters have multiple remote desktops. We recommend:
HPC cluster |
YouTube video |
|---|---|
Alvis |
|
Bianca |
|
COSMOS |
|
Dardel |
|
Kebnekaise |
|
LUMI |
|
Pelle |
|
Rackham |
|
Tetralith |
Exercise 1: using Python packages
login to your HPC cluster
Forgot how to do this?
Answer can be found at day 1
load the Python module of the version below
HPC cluster |
Python version |
|---|---|
Alvis |
|
Bianca |
|
COSMOS |
|
Dardel |
|
Kebnekaise |
|
LUMI |
|
Pelle |
|
Tetralith |
|
Forgot how to do this?
HPC cluster |
Python version |
|---|---|
Alvis |
|
Bianca |
|
COSMOS |
|
Dardel |
|
Kebnekaise |
|
LUMI |
|
Pelle |
|
Tetralith |
|
Confirm that the Python package, indicated in the table below, is absent. You can use any way to do so.
HPC cluster |
Python package |
|---|---|
Alvis |
|
Bianca |
|
COSMOS |
|
Dardel |
|
Kebnekaise |
|
LUMI |
|
Pelle |
|
Tetralith |
|
Answer
From the terminal, use the command below to confirm that the package is not available yet:
HPC cluster |
Command |
|---|---|
Alvis |
|
Bianca |
|
COSMOS |
|
Dardel |
|
Kebnekaise |
|
LUMI |
|
Pelle |
|
Tetralith |
|
In all cases, the package is not yet installed, as that is what we’ll be doing next :-)
Find the software module to load the package. Use either the documentation of the HPC center, or use the module system
Answer: where is this documented?
HPC cluster |
URL to documentation |
|---|---|
Alvis |
|
Bianca |
|
COSMOS |
|
Dardel |
Here, but it is irrelevant |
Kebnekaise |
|
LUMI |
|
Pelle |
|
Tetralith |
Answer: how to use the module system?
In the terminal, type the command as shown below to get a decent hint.
There are many possible terms to use with module spider: whatever
works for you is good too :-)
HPC cluster |
Command |
|---|---|
Alvis |
|
Bianca |
|
COSMOS |
|
Dardel |
|
Kebnekaise |
|
LUMI |
Has no module system, use a container instead. |
|
|
Pelle |
|
Tetralith |
|
Load the software module
Answer
In the terminal, type the following command:
HPC cluster |
Command |
|---|---|
Alvis |
|
Bianca |
|
COSMOS |
|
Dardel |
|
Kebnekaise |
|
LUMI |
Not applicable: we are using a container |
Pelle |
|
Tetralith |
|
Alternatively: |
See the package is now present
Answer
From the terminal, use the command below to confirm that the package is now available:
HPC cluster |
Command |
|---|---|
Alvis |
|
Bianca |
|
COSMOS |
|
Dardel |
|
Kebnekaise |
|
LUMI |
|
Pelle |
|
Tetralith |
|
In all cases, the package is now installed. Well done!
Done?
When done, and if you haven’t done so yet, do Use the tarball with exercises.
After that, read what the next session is about.
You can easily navigate there by pressing the ‘Next’ arrow at the bottom of this page, at the right-hand side