# Start using PyRoot

**URL:** <https://root-forum.cern.ch/t/start-using-pyroot/55636>\
**Category:** Newbie\
**Tags:** python, root\
**Created:** [July 12, 2023, 1:13pm UTC](https://root-forum.cern.ch/t/start-using-pyroot/55636 "2023-07-12T13:13:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lapan](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/e56c9b/32.png) [@lapan](https://root-forum.cern.ch/u/lapan)\
**Post date:** [July 12, 2023, 1:13pm UTC](https://root-forum.cern.ch/t/start-using-pyroot/55636/1 "2023-07-12T13:13:50Z")

</div>

I have Ubuntu 22.04  
I installed python 3.10.6 and ROOT 6.28/04  
But when I try to import ROOT in Python prompt, I get an error

> ModuleNotFoundError: No module named ‘ROOT’

How do I start using ROOT in python

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [July 13, 2023, 8:46am UTC](https://root-forum.cern.ch/t/start-using-pyroot/55636/2 "2023-07-13T08:46:43Z")

</div>

Hi @lapan ,

Easiest way:

```auto
conda create -n myenv -c conda-forge root

```

This will create a working conda environment with ROOT.

**Faster version**

> [@ROOT build with Python 3.7 in centos7](https://root-forum.cern.ch/t/root-build-with-python-3-7-in-centos7/53162/8):
>
> Hi, conda is notoriously slow. I find myself much better when using [mamba](https://mamba.readthedocs.io/en/latest/index.html). It’s the same as using conda, but much faster. I suggest you read the docs, but the following steps should already give you a minimal working environment (taken from [here](https://github.com/conda-forge/miniforge#unix-like-platforms)): curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" bash Mambaforge-$(uname)-$(uname -m).sh # The bash script will install mamba into a folder of your choice # For simplicity, in the follo…

### Other things you may be doing (not recommended)

Maybe the reason why you get the `ModuleNotFoundError` is because you tried to install ROOT manually (e.g. by compiling the source code). I suggest you try one of the normal installation modes at [Installing ROOT - ROOT](https://root.cern/install)

Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [July 13, 2023, 11:14pm UTC](https://root-forum.cern.ch/t/start-using-pyroot/55636/3 "2023-07-13T23:14:44Z")

</div>

Another common reason is that in the terminal where you started the python prompt you forgot to run `source path/to/root/bin/thisroot.sh` (see step 4 at [Installing ROOT - ROOT](https://root.cern/install/#download-a-pre-compiled-binary-distribution) ).
