ModuleNotFoundError: No module named 'ROOT', after installing root from source in centOS 8

Problem: cannot import ROOT
error: ModuleNotFoundError: No module named ‘ROOT’
_ROOT Version: Release 6.22/06 - 2020-12-01
_Platform: centos 8
_Compiler:cmake version 3.11.4
_python on system : 3.6.2
_root-config --python-version : 3.6.8
Steps I used to install root:
went through steps in Building ROOT from source - ROOT
used = /opt/anaconda3/envs/my_custom_env/bin/python
root install directory : /opt/root
added /usr/lib64 in $PYTHONPATH. Nothing else related to root is added in $PYTHONPATH.
Nothing related to root in $PATH.
after running source , /opt/anaconda3/envs/my_custom_env/lib gets added to $LD_LIBRARY_PATH
More info:

  1. root opens up in terminal.
  2. root-config --has-python outputs no
  3. root-config --features has pyroot

I believe the issue could be related to setting the right paths.

@quantumcryohacker just to clarify so you used python from conda and build root from scratch?

@oshadura yes. I used python from conda & built root from source.

@quantumcryohacker if you want, you can install directly from conda, via conda install -c conda-forge root

@oshadura I can find the root package however am not able to install using conda install.
(my_custom_env) [measure@localhost ~]$ conda install -c conda-forge root
Fetching package metadata …

PackageNotFoundError: Packages missing in current channels:

  • root
    When I list the packages available with anaconda search -t conda root

I get
conda-forge/root | 6.22.6 | conda | osx-arm64, linux-64, linux-aarch64, osx-64
: ROOT is a modular scientific software toolkit. It provides all the functionalities needed to deal with big data

Therefore I see it is available.
I have searched for the packages in the following channels:
—several links pointing to conda-forge
I also tried conda install root.

Hi @quantumcryohacker ,
about the original problem: how did you configure the build? @etejedor can probably point out the important cmake variables that need to be set to point our build system to a non-standard python installation.

About not being able to install ROOT via conda. That’s bizarre, can you try creating a new environment rather than installing ROOT in your current one? E.g. with:

conda create -n cern-root -c conda-forge root

and then

conda activate cern-root

to enter the environment.


Information on how to build PyROOT against a non-standard Python installation can be found here:

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