PyROOT import error (PyInit_libPyROOT)

just want to confirm this error on root 6.18-02, with jupyter 4.4.0, which is the latest on debian-10 if you install through the package manager and not pip. I’ve had trouble with pip in the past so I stick with the repository version of python libraries.

Hi @spacestationspaz ,

Thank you for reporting, according to this ticket:

https://sft.its.cern.ch/jira/browse/ROOT-9920

the issue was visible in Jupyter in version 5.7.0 but not in 5.6.0. Last version is 6.0.1, so that one should be ok.
Anyway, you can use the workaround I explained above about modifying jupyter_notebook_config.py.

Hi @etejedor, I fixed the problem with your solution. However, the version of Jupyter I’m using (4.4) is the latest in the debian repositories for Buster. I have to avoid pip because it can cause conflicts with system installed libraries. Thanks.

Glad to hear it works now with the workaround.

And if in the future you move to a newer system with a newer Jupyter, the issue will be already solved.

I am having the same issue, but as I am running PyROOT in Windows, I have just run the executable, and not been able to specify Python versions in CMake.
Do I have to use Python 2 for it to be compatible with PyROOT?

I am using root_v6.18.04 and Python 3.7

File “D:/Documents/root.py”, line 8, in
from ROOT import TCanvas

File “C:\Users\root_v6.18.04\bin\ROOT.py”, line 24, in
import cppyy

File “C:\Users\root_v6.18.04\bin\cppyy.py”, line 61, in
import libPyROOT as _backend

ImportError: DLL load failed: The specified module could not be found.

1 Like

I actually have the same problem right now for Windows. Is there a fix for this?

Hi @ikaul,
if the workaround described above does not help, please open a new thread describing how to reproduce the problem on your system step by step, and providing information on your ROOT version, your jupyter and python version, your operating system, and how you installed ROOT exactly.

Cheers,
Enrico