ROOT module not found: Python3

The make.out.txt file is over 400 lines, but each line begins with ‘[XX%] Built Target …’

I can paste here if you would like to take a look though.

Check around “Built target” lines which contain “move_header_bindings_pyroot”, “move_header_tmva_pymva”, “G__PyROOT”, “PyROOT”, “G__PyMVA”, “PyMVA”.

Has “make” (re-)built anything now?

If there are no problems reported then I have no idea what failed and how.

Actually none of these lines exist in my make file.

I am unsure to check if anything new was built…

Attach the “make.out.txt” file here.

In order to see what what’s new, you could try:

ls -alt `root-config --libdir`

make.out.txt (14.7 KB)

My mistake (I don’t use “pyroot_experimental”) … you do have “move_header_bindings_tpython”, “G__ROOTTPython” and “ROOTTPython”. so have you tried to use it:

[...]$ python3
import ROOT

Yes, I have tried

import ROOT

in the python and python3 environments. I get the “No module named ‘ROOT’” error in both. Specifically:

Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘ROOT’

@Axel We need someone who knows how “pyroot_experimental” is expected to behave (and why it fails).

@Wile_E_Coyote, thank you very much for your time!

Just to make sure … do you actually setup your ROOT before calling python?

[...]$ source /full/path/to/your/root/bin/thisroot.sh
[...]$ python3
import ROOT

I believe so because I added

source /usr/local/bin/thisroot.sh

to my ~/.bashrc

/usr/local/bin/thisroot.sh”?
You showed /home/matthewlee4123/Products/root
So, it should be /home/matthewlee4123/Products/root/bin/thisroot.sh

BTW. You’d better get completely rid of the ROOT distribution which you have in “/usr/local”.

@etejedor could you help out, please?

If you are building with experimental PyROOT you should not see libPyROOT.so anymore, now there are other libraries. Can you check if you see libcppyy3_8.so or libROOTPythonizations3_8.so ?

A priori the messages that CMake prints look ok, it found interpreter and development packages for Python3, so it should be building PyROOT with that one. It should not matter because it already found the python you wanted, but -DPYTHON=/usr... should be -DPYTHON_LIBRARIES=....

Also mentioning @maxgalli and @oshadura so they are aware.

There is a full list of all built libraries in one of the previous posts (and running “make” again doesn’t complain about anything, as shown in another previous post).

Can it be that the building of ROOT went amok because there’s another ROOT distribution in “/usr/local”?

Can you try the following?

cmake …/root-6.20.04 -Dpyroot_experimental=ON -DPYTHON_EXECUTABLE=/usr/bin/python3

then

/path_to_your_build_directory/bin/thisroot.sh

then try once again to import ROOT from the python3 prompt.

(Just in case, either do it in a new build directory or remove CMakeCache.txt first)

Hello @maxgalli - I tried building with those flags and now I am receiving the error:

free(): invalid pointer
Aborted (core dumped)

What are you executing that lead to those errors? Are you sure there is no mixing of ROOT releases/builds in the environment?

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