eleicht
eleicht

Reputation: 35

Python 2.7 error import ROOT

I installed root.exe in the folder C:\root_v5.34.36, folder C:\root_v5.34.36\bin which contains ROOT.py

When I started a Jupiter Notebook (anaconda), I write :

import sys
sys.path.append("C:\root_v5.34.36\bin")

Then

import ROOT

And it displays :

ImportError                               Traceback (most recent call last)
<ipython-input-2-b332e25ada1f> in <module>()
----> 1 import ROOT

ImportError: No module named ROOT

What's wrong?

Upvotes: 2

Views: 1653

Answers (2)

Nathanael Farley
Nathanael Farley

Reputation: 400

You need to run the file thisroot.bat usually found in the config folder of the ROOT directory before starting the notebook application.

This should be done by opening a powershell and typing:

cd  C:\root_v5.34.36
.\config\thisroot.bat
C:\WhereverTheJupyterNotebookApplicationIs\JupyterNotebook.exe

Upvotes: 0

Noe Fernandez
Noe Fernandez

Reputation: 114

Try changing the root bin path to sys.path.append("C:\\root_v5.34.36\\bin")

Upvotes: 2

Related Questions