Importing libraries with pyROOT

I’m having trouble importing my libraries from specific directories into pyROOT with MacOS 10.12.

I am using the commit here as per guidance here.

My library lives in


and my environment variables are:


So I use ROOT:

root [0] gSystem->Load("");
root [1] b = BinomialEff();
root [2] b.Nt = 100
(double) 100.000000

That is happy.

Then I try pyroot:

>>> import ROOT
>>> ROOT.gSystem.Load("")

and it is unhappy:

Error in <TMacOSXSystem::FindDynamicLibrary>: does not exist in .:/software/root-v6-11-02-install/lib:/usr/local/lib:/usr/X11R6/lib:/usr/lib:/lib:/lib/x86_64-linux-gnu:/usr/local/lib64:/usr/lib64:/lib64:

but, if I explicitly tell it where to go, it is happy again:

>>> import ROOT
>>> ROOT.gSystem.Load("")
>>> import os
>>> ROOT.gSystem.Load( '%s/standalone/' % ( os.getenv('PREDDIST_DIR') ) )
>>> b = ROOT.BinomialEff()
>>> b.Nt = 100.
>>> b.Nt

What am I doing wrong, or is this another bug?

Are you using the system-provided python? If yes, install one from any of the packagers (MacPorts, Homebrew, etc.) or directly from source and use that. Apple uses Python in all kinds of system utilities and has modified it (as a security measure) not to use dynamic linker envars.

Thanks for the response. Yes, I’m using the system python, on recommendations from other ROOT posts ;). OK, I will try another python version.

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