Installing pyRoot on mac osx 10.12.5 Sierra and Anaconda

I am a newbie and I apologize if I am repeating a question that has been asked in the past and unintentionally overlooked it. I know that I am doing something funny but I do not know what it is. I appreciate it if you could kindly help.

I am trying to install pyROOT on Mac OS X 10.12.5 using anaconda (using python 3).

I did the following:

  1. Installed ROOT 6.08/06 - 2017 - 03 - 02
  2. I have Anaconda 4.4.0 with Anaconda navigator 1.6.2 - originally with Python 3.x and added new env for python 2.x
  3. Did: source /Applications/root_v6.08.06/bin/
  4. root --notebook

  5. it gives me:

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
0:97: execution error: “http://localhost:8888/tree?token=2eab60ab3453dbf81791e7ff6df190f9f2a53aec48280012” doesn’t understand the “open location” message. (-1708)

  1. I copied the link and copied it into the Safari - it gives the ROOT notebook interface. Under the “New” drop down menu I get: Python 3, R and ROOT C++.

  2. I chose: Python3, then I get the notebook.

  3. I enter: Import ROOT. Then I get the following unhappy message:


ImportError Traceback (most recent call last)
in ()
----> 1 import ROOT

/Applications/root_v6.08.06/lib/ in ()
22 ### system and interpreter setup ------------------------------------------------
23 import os, sys, types
—> 24 import cppyy
26 ## there’s no version_info in 1.5.2

/Applications/root_v6.08.06/lib/ in ()
58 sys.setdlopenflags( 0x100 | 0x2 ) # RTLD_GLOBAL | RTLD_NOW
—> 60 import libPyROOT as _backend
62 # reset dl flags if needed

ImportError: dynamic module does not define module export function (PyInit_libPyROOT)

9. If I go back and choose Root C++, then I get the following unhappy message:


 The kernel has died, and the automatic restart has failed. It is possible the kernel cannot be restarted. If you are not able to restart the kernel, you will still be able to save the notebook, but running code will no longer work until the notebook is reopened.

Thank you for your help in advance.

I had a similar problem.
I cleanly uninstalled anaconda and repeated the same process you mentioned but by using miniconda instead of anaconda.
If you don’t know, miniconda is same as anaconda but not all libraries are preinstalled. Now you can use the command:

conda install jupyter

to install jupyter notebook interface.

After all this, I have no problem in importing ROOT in Python.
But I still have the issue of Kernal dying if I choose Root C++

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