# ROOT importation problem for the use of PyROOT

**URL:** <https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133>\
**Category:** Newbie\
**Tags:** python, root\
**Created:** [April 25, 2024, 8:45am UTC](https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133 "2024-04-25T08:45:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SarahBlind](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@SarahBlind](https://root-forum.cern.ch/u/SarahBlind)\
**Post date:** [April 25, 2024, 8:45am UTC](https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133/1 "2024-04-25T08:45:28Z")

</div>

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

```auto
>>> 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 :

```auto
~$ 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

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [April 25, 2024, 8:59am UTC](https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133/2 "2024-04-25T08:59:49Z")

</div>

Hi Sarah,

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

Best,  
D

---

<div class="post-metadata">

**Author:** ![SarahBlind](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@SarahBlind](https://root-forum.cern.ch/u/SarahBlind)\
**Post date:** [April 25, 2024, 9:08am UTC](https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133/3 "2024-04-25T09:08:49Z")

</div>

Dear Danilo,

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

```auto
sudo snap install root-framework

```

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

Regards,  
Sarah

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [April 25, 2024, 10:59am UTC](https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133/4 "2024-04-25T10:59:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SarahBlind](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/6bbea6/32.png) [@SarahBlind](https://root-forum.cern.ch/u/SarahBlind)\
**Post date:** [April 26, 2024, 6:23am UTC](https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133/5 "2024-04-26T06:23:58Z")

</div>

Dear Danilo,

You were right.

I uninstalled root and reinstalled it following

[https://root.cern/install/#download-a-pre-compiled-binary-distribution](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

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [April 26, 2024, 8:44am UTC](https://root-forum.cern.ch/t/root-importation-problem-for-the-use-of-pyroot/59133/6 "2024-04-26T08:44:07Z")

</div>

Hi Sarah,

Great. Thanks for the follow up.

D
