Problem with PyROOT installation


ROOT Version: 6.20/00
Platform: Ubuntu 20.04.2 LTS
Compiler: gcc 9.3.0


Hi,
I am trying to compile ROOT with PyROOT (python version 3.8.5).
Unfortunately, I am stuck with a problem similar to ones I have found here:

I execute these lines:

cmake -Dgdml=ON -DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/install -DPYTHON_EXECUTABLE=/local/home/al264242/Documents/Soft/anaconda3/bin/python3.8  -DPYTHON_INCLUDE_DIR=/local/home/al264242/Documents/Soft/anaconda3/include ../source
make -j8 install

The compilation looks fine, but when I try to import ROOT I receive an error message:

>>> import ROOT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/local/home/al264242/Documents/Soft/root-6.20.00/install/lib/ROOT.py", line 24, in <module>
    import cppyy
  File "/local/home/al264242/Documents/Soft/root-6.20.00/install/lib/cppyy.py", line 61, in <module>
    import libPyROOT as _backend
ImportError: dynamic module does not define module export function (PyInit_libPyROOT)
>>> 

I could also provide the CMakeCache.txt:
CMakeCache.txt (143.3 KB)

Would be grateful for any tip on what exactly I am doing wrong.

My bad, the problem was in the incorrect setup of the directories.

This works fine:

cmake -Dgdml=ON -DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/install -DPYTHON_EXECUTABLE=/local/home/al264242/Documents/Soft/anaconda3/bin/python3.8   ../source
make -j8 install

Good to know that you managed to solve the issue, @alobasenko!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.