Python 3

Link to setup python environment !

Launching python 3

For using Python, typ the command “python3”

$ python3
Python 3.9.21 (main, Aug 19 2025, 00:00:00)
[GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.

You can use a more recent version of Python with the loading of a Python module. For example,

$ ml python/3.13.7 
$ python3
Python 3.13.7 (main, Sep 9 2025, 10:17:02) [GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.

Loading a library.

python3
Python 3.9.21 (main, Aug 19 2025, 00:00:00)
[GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas

A library can be installed in a Python version but not in another.

$ ml python/3.11.7 
$ python3
Python 3.11.7 (main, Jan 9 2026, 13:34:55) [GCC 15.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pandas'

The library called pandas is well installed in the version 3.9.21 but not into the version 3.11.7.

Installation of a library

As a user, possibility to install a Python library.

Example with pandas

$ ml python/3.11.7
$ pip3 install --no-cache-dir --upgrade --user pandas
Collecting pandas
  Downloading pandas-3.0.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (79 kB)
Collecting numpy>=1.26.0 (from pandas)
  Downloading numpy-2.4.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (6.6 kB)
Collecting python-dateutil>=2.8.2 (from pandas)
  Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas)
  Downloading six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Downloading pandas-3.0.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (11.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.3/11.3 MB 371.6 kB/s  0:00:29
Downloading numpy-2.4.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.9/16.9 MB 377.3 kB/s  0:00:44
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Downloading six-1.17.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, numpy, python-dateutil, pandas
Successfully installed numpy-2.4.2 pandas-3.0.1 python-dateutil-2.9.0.post0 six-1.17.0
$ python3
Python 3.11.7 (main, Jan  9 2026, 13:34:55) [GCC 15.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas

Notes :

  • In some cases, installation may fail. Check that the library is compatible with your version of Python.
  • The libraries are put into your hidden folder .local.