@ksmith: Thanks for this bit!
I’ve rebuilt ROOT using
sudo cmake -Dall=ON -Dpython3=ON -Dpython_executable=/usr/bin/python3.5m/ -Dpython_library=/usr/lib/python3.5/ -Dpython_include_dir=/usr/include/python3.5m/ /localscratch//root-6.14.04/
sudo cmake --build .
Once again, import ROOT
works only in Python 2.7.13, even though I set -Dpython3=ON
. In Python 3.5.3 I get:
>>> import ROOT
Traceback (most recent call last):
File “”, line 1, in
File “/localscratch//root_6.14.04/lib/ROOT.py”, line 24, in
import cppyy
File “/localscratch//root_6.14.04/lib/cppyy.py”, line 61, in
import libPyROOT as _backend
ImportError: dynamic module does not define module export function (PyInit_libPyROOT)
Also, for some reason, source thisroot.sh
throws errors (bash: cd: too many arguments
, bash: sed: No such file or directory
, bash: grep: command not found
) and I have to reboot in order for this to execute.
@etejedor: Doing which python3.5
gives /usr/bin/python3.5
… Could it be that ROOT requires the use of exactly /python3
(instead of /python3.5
, /python3.5m
or /python3.7
)? And maybe the trailing backslashes are causing trouble (files getting interpreted as folders)…
I’m rebuilding (again ) using:
sudo cmake -Dall=ON -Dpython3=ON -Dpython_executable=/usr/bin/python3.5 -Dpython_library=/usr/lib/python3.5 -Dpython_include_dir=/usr/include/python3.5 /localscratch//root-6.14.04/
/edit: Okay, same result! import ROOT
works in Python 2, but not Python 3. Not sure what I’m missing here… CMakeCache.txt
did not contain any such long entries for either of the three options. For PYTHON_LIBRARY
, do I need to explicitly point to a .SO-file?