# Root and python are in different directory

**URL:** <https://root-forum.cern.ch/t/root-and-python-are-in-different-directory/50737>\
**Category:** Newbie\
**Created:** [July 9, 2022, 2:22pm UTC](https://root-forum.cern.ch/t/root-and-python-are-in-different-directory/50737 "2022-07-09T14:22:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![isbara](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/i/e47c2d/32.png) [@isbara](https://root-forum.cern.ch/u/isbara)\
**Post date:** [July 9, 2022, 2:22pm UTC](https://root-forum.cern.ch/t/root-and-python-are-in-different-directory/50737/1 "2022-07-09T14:22:28Z")

</div>

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  
/opt/homebrew/bin/root

When I run the where python command, I get  
/Users/name/opt/anaconda3/bin/python  
/usr/bin/python

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  
3.9.13

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

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

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 9, 2022, 7:11pm UTC](https://root-forum.cern.ch/t/root-and-python-are-in-different-directory/50737/2 "2022-07-09T19:11:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [July 11, 2022, 8:09am UTC](https://root-forum.cern.ch/t/root-and-python-are-in-different-directory/50737/3 "2022-07-11T08:09:53Z")

</div>

Hello,

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:

> **[Installing ROOT](https://root.cern/install/#conda)**
>
> Data Analysis Framework

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 25, 2022, 8:10am UTC](https://root-forum.cern.ch/t/root-and-python-are-in-different-directory/50737/4 "2022-07-25T08:10:18Z")

</div>

Closed on July 25, 2022, 8:10am UTC

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