ROOT importation problem for the use of PyROOT

Dear root users,

I want to use PyROOT for a Gate root files analysis.
When I try to import ROOT with python I get the following error

>>> import ROOT
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'ROOT'
>>> 

I think the problem comes from the fact that my root python version is higher than my python version :

~$ python3 --version
Python 3.8.10
~$ root-config --python-version
3.10.12

For other reasons I want to stay on Ubuntu 20.04.6 LTS. Installing a python version that is not part of the official distribution repository does not seem a good idea.

Is there any alternative so I can use PyROOT ?

Many thanks your help,
Sarah


Platform : Ubuntu 20.04.6 LTS
Root version : ROOT Version: 6.30/04
Python version : Python 3.8.10

Hi Sarah,

We build and release binaries for Ubuntu 20.04 relying on system packages, including Python.
How did you obtain ROOT?

Best,
D

Dear Danilo,

Thank you for your response.
I installed the root-framework snap,

sudo snap install root-framework

as suggested in the software library for the Gate simulation software installation.

Regards,
Sarah

Hi Sarah,

Can it be that the Snap build depends on a different python version? We are not responsible for it, even if we are very grateful to all packagers that put forward solid work which is extremely helpful for the community.

Best,
D

Dear Danilo,

You were right.

I uninstalled root and reinstalled it following

https://root.cern/install/#download-a-pre-compiled-binary-distribution

Now the root python version is 3.8.10.
My system was also missing the tbb library, but now every thing works fine.

Thank you so much !
Regards,
Sarah

Hi Sarah,

Great. Thanks for the follow up.

D