1.3.1. Python version: greater than 3.8

From Uranie version 4.9, only Python greater than 3.8 can be used due to the use of ROOT version v6.32 (Python 2 is deprecated). Two words of caution about this:

  • The macros provided in the python version of this manual have indeed been tested with Python 3 (upper than 3.8).

  • Note, historically, from Uranie version 4.5 to v4.8, both Python 2 and 3 were used at the same time if it is installed again a ROOT version from v6.20.00 to v6.28.06. In order to get this compatibility, it means that the printing format has to be homogenised and this implies that from Uranie version 4.2, these macros might not be working anymore for Python version below or equal to 2.6.

Possible python configuration on a Linux OS

When typing the following command on many present Linux OS

ls -l `which python`  && ls -l `which python3`

one can get these lines

lrwxrwxrwx. 1 root root 9  8 févr.  2023 /usr/bin/python -> ./python3
lrwxrwxrwx. 1 root root 10  8 févr.  2023 /usr/bin/python3 -> python3.11

Today’s operating systems usually embed both versions of python and many of these still use the version 2 as a reference (see the block above with both python versions). Given the fact that one can have as many different python versions as possible, it should be possible to specify which one is of interest for the ongoing installation. The following lines should be used to specify the python version to be used, providing that the “dev” packages are indeed installed for this version:

cmake ${PATH_TO_ROOT_SOURCES} -DPYTHON_EXECUTABLE=${PATH_TO_PYTHON_BIN} -DPYTHON_INCLUDE_DIR=${PATH_TO_PYTHON_INC}  -DPYTHON_LIBRARY=${PATH_TO_PYTHON_LIB} ...

These three specific python flags should be used both for ROOT and Uranie in a coherent way in order to install both platforms with a chosen Python’s version. To get the recommended cmake line both for ROOT and Uranie see the README provided with the Uranie-sources.