Root and python are in different directory

I am new in root.
I cannot import ROOT. I use zsh. When I try to run some code that include import ROOT code line I get an error like that.
ModuleNotFoundError: No module named ‘ROOT’

When I run the where root command, I get

When I run the where python command, I get

Root version is From tags/v6-26-04@v6-26-04, ROOT 6.26/04
python version is python 3.9.7

When I run root-config --python3-version , I get

When I run root-config --has-pyroot , I get,

How do I cope with import error? I hope I explain myself clearly.

Maybe you are mixing a conda install with a local install. Maybe @etejedor can help


As @bellenot hinted, it looks like you are trying to use conda’s python with a homebrew ROOT installation. Please try using the system python instead of conda’s, or alternatively install ROOT with conda and use conda’s python. Instructions on how to install ROOT with conda can be found here:

1 Like

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