scikit-hep / root_numpy

The interface between ROOT and NumPy

Home Page:http://scikit-hep.org/root_numpy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python error

imoric opened this issue · comments

root_numpy is causing an error on Mac I cannot solve ->
Running 2.7 Python installed by Homebrew and doing a test from root_numpy library:
(when I run from root_numpy import testdata, root2rec I get the Python rocket on dock)

Python 2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import ROOT
import numpy
import pandas
from root_numpy import testdata, root2rec
root2rec(testdata.get_filepath())[:20]
/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py:271: DeprecationWarning: root2rec is deprecated and will be removed in 5.0.0. Instead use root2array(...).view(np.recarray)
DeprecationWarning)
Error in TTreePlayer::UnbinnedFit: Unknown function: /usr/local/lib/python2.7/site-packages/root_numpy/testdata/test.root
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py", line 278, in root2rec
warn_missing_tree).view(np.recarray)
File "/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py", line 231, in root2array
warn_missing_tree)
File "root_numpy/src/tree.pyx", line 600, in _librootnumpy.root2array_fromfile (root_numpy/src/_librootnumpy.cpp:600)
IOError: unable to access tree 'tree' in /usr/local/lib/python2.7/site-packages/root_numpy/testdata/test.root

Another example:

Python 2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import root_numpy as rnp
from ROOT import TFile
f = TFile.Open("Data/Mimac_Chamber3_20160113_151631_Comimac_Fluorine_10keV.root")
t = f.Get("tree")
rnp.tree2array(t)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py", line 417, in tree2array
cache_size)
File "root_numpy/src/tree.pyx", line 620, in _librootnumpy.root2array_fromtree (root_numpy/src/_librootnumpy.cpp:620)
File "root_numpy/src/tree.pyx", line 166, in _librootnumpy.tree2array (root_numpy/src/_librootnumpy.cpp:166)
ValueError: tree has no branches


tree has branches

Hi @imoric, I tried your entire environment:

(Optimization) Lord Stark:~$ localSetupROOT6 
(Optimization) Lord Stark:~$ python
Python 2.7.13 (default, Dec 18 2016, 07:03:39) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>> import numpy
>>> from root_numpy import testdata, root2rec
>>> root2rec(testdata.get_filepath())[:20]
/Users/kratsg/.virtualenvs/Optimization/lib/python2.7/site-packages/root_numpy/_tree.py:271: DeprecationWarning: root2rec is deprecated and will be removed in 5.0.0. Instead use root2array(...).view(np.recarray)
  DeprecationWarning)
rec.array([(0, 0.004806077107787132, -0.4221794009208679, 1.5405316352844238),
 (1, 0.09474281966686249, 1.5246920585632324, 1.216752529144287),
 (2, -0.13630907237529755, -0.19921572506427765, -0.2937643527984619),
 (3, -0.11835826188325882, -1.160293459892273, 0.0123621029779315),
 (4, 0.022064030170440674, -0.07125271111726761, -1.3216177225112915),
 (5, 1.7443270683288574, -0.3323773443698883, -0.24727270007133484),
 (6, -1.1802152395248413, -1.190427541732788, -2.0097615718841553),
 (7, 1.3383747339248657, 0.4881706237792969, 0.2963598370552063),
 (8, 0.24391278624534607, -1.092339038848877, -0.599092960357666),
 (9, -0.7879268527030945, -2.5801382064819336, -1.2164770364761353),
 (10, -1.2432823181152344, -0.23788228631019592, 1.8004082441329956),
 (11, -0.4688774645328522, -2.2365758419036865, -0.29860037565231323),
 (12, 1.7810043096542358, -0.886005163192749, 0.25640609860420227),
 (13, -0.36850985884666443, -0.7155455350875854, -0.38682225346565247),
 (14, -0.30102837085723877, -0.12731395661830902, 0.8531195521354675),
 (15, 0.45515552163124084, -0.031115440651774406, 1.199049711227417),
 (16, 0.35927027463912964, -0.5585591793060303, 0.9324544072151184),
 (17, 1.390525460243225, 0.9786960482597351, -0.8946467041969299),
 (18, 0.27789127826690674, -0.7526489496231079, -0.6168140172958374),
 (19, -1.2985329627990723, 0.9864599108695984, 0.3030785620212555)], 
          dtype=[('i', '<i4'), ('x', '<f4'), ('y', '<f4'), ('z', '<f4')])

Since this also passes tests, my first thought is that you installed ROOT on the older python but didn't recompile the PyROOT bindings on the newer one. My second thought is you have root_numpy on the older python, but didn't recompile on the newer one. Can you try reinstalling root?

brew uninstall root6
brew install --force root6

and then

pip uninstall root_numpy
pip --force-reinstall root_numpy

first.

Actually I misspoke. I installed with cmake. When I wrote brew I meant using Homebrew python (installed python with it and then ROOT used it to compile).
Tried installing ROOT with brew but produces an error at GEOM so abandoned that.

But yes, I am coming to the same conclusion that root_numpy/ROOT/PyROOT are not using the same python. Not sure what to do about it though. You recommend I try to succeed installing with brew?

Edit: Also, I tried doing it in the right order. First install python with brew (brew install pip), then cmake compile ROOT, then pip install numpy, pip install pandas, pip install root_numpy, pip install root_pandas. I a sourcing thisroot.sh in my bash file, but there might be an issue in the PYTHONDIR/ROOTSYS so python/numpy from RootBuildDirectory/lib is used, and not homebrew python - if that makes any sense.

Edit2:

-) root-config --config -----> ...PYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.13...

-) echo $PYTHONPATH
/Users/imor/Root/BuildPy2/lib:/usr/local/lib/python2.7/site-packages

-) $ echo $ROOTSYS
/Users/imor/Root/BuildPy2

Try reinstalling root_numpy first. If you have the cmake logs, that would be great, so I can check the python linked there. Can you also confirm that /usr/local/bin/python is symlinked to your Cellar?

Gave me no such option so did:
pip install --upgrade --no-deps --force-reinstall root_numpy

This is the error:

Python 2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import ROOT
import numpy>>> import numpy
import numpy
from root_numpy import testdata, root2rec
root2rec(testdata.get_filepath())[:20]
/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py:271: DeprecationWarning: root2rec is deprecated and will be removed in 5.0.0. Instead use root2array(...).view(np.recarray)
DeprecationWarning)
Error in TTreePlayer::UnbinnedFit: Unknown function: /usr/local/lib/python2.7/site-packages/root_numpy/testdata/test.root
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py", line 278, in root2rec
warn_missing_tree).view(np.recarray)
File "/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py", line 231, in root2array
warn_missing_tree)
File "root_numpy/src/tree.pyx", line 600, in _librootnumpy.root2array_fromfile (root_numpy/src/_librootnumpy.cpp:600)
IOError: unable to access tree 'tree' in /usr/local/lib/python2.7/site-packages/root_numpy/testdata/test.root

cmake --all /Users/imor/Root/root-6.09.02
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /usr/local/bin/gfortran
-- The Fortran compiler identification is GNU 6.2.0
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Check for working Fortran compiler: /usr/local/bin/gfortran
-- Check for working Fortran compiler: /usr/local/bin/gfortran -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/local/bin/gfortran supports Fortran 90
-- Checking whether /usr/local/bin/gfortran supports Fortran 90 -- yes
-- Performing Test HAS_CXX11
-- Performing Test HAS_CXX11 - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found a Mac OS X System 10.12
-- Found a 64bit system
-- Found LLVM compiler collection
-- ROOT Platform: macosx
-- ROOT Architecture: macosx64
-- Build Type: RelWithDebInfo
-- Compiler Flags: -m64 -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -stdlib=libc++ -O2 -g -DNDEBUG
-- Looking for ZLib
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.8")
-- Looking for Unuran
-- Could NOT find UNURAN (missing: UNURAN_LIBRARY UNURAN_INCLUDE_DIR)
-- Unuran not found. Switching on builtin_unuran option
-- Building freetype version 2.6.1 included in ROOT itself
-- Looking for PCRE
-- Found PCRE: /usr/local/include
-- Looking for LZMA
-- Found LZMA includes at /usr/local/include
-- Found LZMA library at /usr/local/lib/liblzma.dylib
-- Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR)
-- Found TIFF: /usr/local/lib/libtiff.dylib (found version "4.0.7")
-- Found PNG: /usr/local/lib/libpng.dylib (found version "1.6.28")
-- Found JPEG: /usr/local/lib/libjpeg.dylib
-- Building AfterImage library included in ROOT itself
-- Looking for GSL
-- Found GSL: /usr/local/Cellar/gsl/2.3/include (found suitable version "2.3", minimum required is "1.10")
-- Looking for Python
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.13")
-- Found Python interpreter version 2.7
-- Found PythonLibs: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib (found version "2.7.13")
-- Found NUMPY: /usr/local/lib/python2.7/site-packages/numpy/core/include (found version "1.12.1")
-- Looking for OpenGL
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework
-- Looking for gl2ps
-- Could NOT find GL2PS (missing: GL2PS_LIBRARY GL2PS_INCLUDE_DIR)
-- gl2ps not found. Switching on builtin_gl2ps option
-- Looking for Graphviz
-- Found GRAPHVIZ: /usr/local/include
-- Looking for Bonjour
-- Checking whether Bonjour/Avahi is supported
-- Looking for Kerberos 5
-- Found KRB5: /usr/lib/libkrb5.dylib
-- Looking for LibXml2
-- Found LibXml2: /usr/lib/libxml2.dylib (found version "2.9.2")
-- Looking for OpenSSL
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
-- OpenSSL not found. Switching off ssl option
-- Looking for Castor
-- Could NOT find CASTOR (missing: CASTOR_shift_LIBRARY CASTOR_INCLUDE_DIR)
-- Castor not found. Switching off castor option
-- Looking for RFIO
-- Could NOT find CASTOR (missing: CASTOR_shift_LIBRARY CASTOR_INCLUDE_DIR)
-- Castor or DPM not found. Switching off rfio option
-- Looking for MySQL
-- Found MYSQL: /usr/local/Cellar/mysql/5.7.16/include/mysql
-- Looking for Oracle
-- Oracle not found.
-- Oracle: You can specify includes: -DORACLE_PATH_INCLUDES=/usr/include/oracle/10.2.0.3/client
-- currently found includes:
-- Oracle: You can specify libs: -DORACLE_PATH_LIB=/usr/lib/oracle/10.2.0.3/client/lib
-- currently found libs: ORACLE_LIBRARY_OCCI-NOTFOUND;ORACLE_LIBRARY_CLNTSH-NOTFOUND;ORACLE_LIBRARY_LNNZ-NOTFOUND
-- Oracle not found. Switching off oracle option
-- Looking for ODBC
-- Could NOT find ODBC (missing: ODBC_INCLUDE_DIR)
-- ODBC not found. Switching off odbc option
-- Looking for PostgreSQL
-- Found PostgreSQL: /usr/local/include
-- Looking for SQLite
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.1")
-- Found Sqlite: /usr/include
-- Looking for Pythia6
-- Pythia6 not found. Switching off pythia6 option
-- Looking for Pythia8
-- Could NOT find Pythia8 (missing: PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARY)
-- Pythia8 not found. Switching off pythia8 option
-- Looking for FFTW3
-- Found fftw3 includes at /usr/local/include
-- Found fftw3 library at /usr/local/lib/libfftw3.dylib
-- Looking for CFITSIO
-- Could NOT find CFITSIO (missing: CFITSIO_INCLUDE_DIR CFITSIO_LIBRARY)
-- CFITSIO not found. You can enable the option 'builtin_cfitsio' to build the library internally'
-- For the time being switching off 'fitsio' option
-- Support Shadow password not found. Switching off shadowpw option
-- Monalisa not found. Set variable MONALISA_DIR to point to your Monalisa installation
-- For the time being switching OFF 'monalisa' option
-- Looking for XROOTD
-- Found Xrootd version num: 4.5.0 (setting -DROOTXRDVERS=400050000)
-- libXrdMain not found: xproofd will be a wrapper around xrootd
-- include_dirs: /usr/local/include/xrootd;/usr/local/include/xrootd/private
-- libraries: /usr/local/lib/libXrdUtils.dylib;/usr/local/lib/libXrdClient.dylib;/usr/local/lib/libXrdCl.dylib
-- Could NOT find GFAL (missing: GFAL_INCLUDE_DIR SRM_IFCE_INCLUDE_DIR GFAL_LIBRARY)
-- GFAL library not found. Set variable GFAL_DIR to point to your gfal installation
and the variable SRM_IFCE_DIR to the srm_ifce installation
-- For the time being switching OFF 'gfal' option
-- Could NOT find DCAP (missing: DCAP_INCLUDE_DIR DCAP_LIBRARY)
-- dCap library not found. Set variable DCAP_DIR to point to your dCache installation
-- For the time being switching OFF 'dcache' option
-- Found LDAP: /usr/include
-- Could NOT find CHIRP (missing: CHIRP_INCLUDE_DIR CHIRP_LIBRARY)
-- chirp library not found. Set variable CHIRP_DIR to point to your chirp installation
-- For the time being switching OFF 'chirp' option
-- Could NOT find HDFS (missing: HDFS_INCLUDE_DIR HDFS_LIBRARY)
-- hdfs library not found. Set variable HDFS_DIR to point to your hdfs installation
-- For the time being switching OFF 'hdfs' option
-- Looking for DAVIX
-- Could NOT find DAVIX (missing: DAVIX_INCLUDE_DIR DAVIX_LIBRARY)
-- Davix not found. You can enable the option 'builtin_davix' to build the library internally'
-- For the time being switching off 'davix' option
-- >>> Option 'glite' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'sapdb' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'srp' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- Enabled support for: asimage astiff bonjour builtin_afterimage builtin_ftgl builtin_freetype builtin_gl2ps builtin_glew builtin_unuran builtin_llvm cxx11 libcxx cling cocoa exceptions explicitlink fftw3 fortran gviz genvector krb5 ldap mathmore memstat mysql opengl pch pgsql python shared sqlite thread tmva xml xrootd
-- The ASM compiler identification is AppleClang
-- Found assembler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Found libtool - /usr/bin/libtool
-- Target triple: x86_64-apple-darwin16.1.0
-- Native target architecture is X86
-- Threads disabled.
-- Doxygen disabled.
-- Sphinx disabled.
-- Go bindings disabled.
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Targeting X86
-- Clang version: 3.9.0
-- Cling version (from VERSION file): ROOT_0.4~dev
-- Cling will look for C++ headers in '/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1' at runtime.
-- And if not found, will invoke: '/Library/Developer/CommandLineTools/usr/bin/c++ ' for them.
-- Performing Test CXX_HAS_fno_rtti
-- Performing Test CXX_HAS_fno_rtti - Success
-- Performing Test C_HAS_Wno_strict_overflow
-- Performing Test C_HAS_Wno_strict_overflow - Success
-- Performing Test C_HAS_Wno_maybe_uninitialized
-- Performing Test C_HAS_Wno_maybe_uninitialized - Failed
-- Performing Test CXX_HAS_Wno_shadow
-- Performing Test CXX_HAS_Wno_shadow - Success
-- Performing Test CXX_HAS_fno_strict_aliasing
-- Performing Test CXX_HAS_fno_strict_aliasing - Success
-- Performing Test found_setresuid
-- Performing Test found_setresuid - Failed
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Failed
-- Performing Test found_stdexpstringview
-- Performing Test found_stdexpstringview - Success
-- Performing Test found_stod_stringview
-- Performing Test found_stod_stringview - Failed
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Failed
-- Performing Test found_stdinvoke
-- Performing Test found_stdinvoke - Failed
Running /Users/imor/Root/root-6.09.02/build/unix/compiledata.sh
Making include/compiledata.h
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/imor/Root/BuildPy2

Can you also confirm that /usr/local/bin/python is symlinked to your Cellar?

This shows it?

Is-MacBook-Pro:BuildPy2 imor$ ls -l /usr/local/bin/python
lrwxr-xr-x 1 imor admin 34 Mar 29 10:59 /usr/local/bin/python -> ../Cellar/python/2.7.13/bin/python

-- Found NUMPY: /usr/local/lib/python2.7/site-packages/numpy/core/include (found version "1.12.1")

I wasn't aware ROOT was going to link to numpy too? Perhaps you should uninstall numpy, scipy, and root_numpy, recompile ROOT (making sure it doesn't pick those up), and then install numpy, scipy, and root_numpy. There's definitely a version difference somewhere...

Still error. Uninstalled numpy, scipy, root numpy, cmake compiled ROOT, installed numpy (force cause it said its already installed although not in cmake log this time), scipy and root_numpy.

Python 2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import ROOT
import numpy
from root_numpy import testdata, root2rec
root2rec(testdata.get_filepath())[:20]
/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py:271: DeprecationWarning: root2rec is deprecated and will be removed in 5.0.0. Instead use root2array(...).view(np.recarray)
DeprecationWarning)
Python(43321,0x7fffb7a913c0) malloc: *** error for object 0x7fe33b0cde58: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

and a Python error:
Process: Python [43321]
Path: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: org.python.python
Version: 2.7.13 (2.7.13)
Code Type: X86-64 (Native)
Parent Process: bash [2914]
Responsible: Python [43321]
User ID: 501

Date/Time: 2017-03-30 01:51:54.323 +0800
OS Version: Mac OS X 10.12.1 (16B2657)
Report Version: 12
Anonymous UUID: 6DD12C87-6D7C-4D77-DF77-2BDBB7DD6DB2

Sleep/Wake UUID: AE9CA8FB-3605-4B81-8936-CC0B905E6ADC

Time Awake Since Boot: 84000 seconds
Time Since Wake: 900 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY


cmake log:

Is-MacBook-Pro:BuildPy2 imor$ cmake -Droofit=ON -Dminuit2=ON -Dgdml=ON /Users/imor/Root/root-6.09.02
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /usr/local/bin/gfortran
-- The Fortran compiler identification is GNU 6.2.0
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Check for working Fortran compiler: /usr/local/bin/gfortran
-- Check for working Fortran compiler: /usr/local/bin/gfortran -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/local/bin/gfortran supports Fortran 90
-- Checking whether /usr/local/bin/gfortran supports Fortran 90 -- yes
-- Performing Test HAS_CXX11
-- Performing Test HAS_CXX11 - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found a Mac OS X System 10.12
-- Found a 64bit system
-- Found LLVM compiler collection
-- ROOT Platform: macosx
-- ROOT Architecture: macosx64
-- Build Type: RelWithDebInfo
-- Compiler Flags: -m64 -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -stdlib=libc++ -O2 -g -DNDEBUG
-- Looking for ZLib
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.8")
-- Looking for Unuran
-- Could NOT find UNURAN (missing: UNURAN_LIBRARY UNURAN_INCLUDE_DIR)
-- Unuran not found. Switching on builtin_unuran option
-- Building freetype version 2.6.1 included in ROOT itself
-- Looking for PCRE
-- Found PCRE: /usr/local/include
-- Looking for LZMA
-- Found LZMA includes at /usr/local/include
-- Found LZMA library at /usr/local/lib/liblzma.dylib
-- Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR)
-- Found TIFF: /usr/local/lib/libtiff.dylib (found version "4.0.7")
-- Found PNG: /usr/local/lib/libpng.dylib (found version "1.6.28")
-- Found JPEG: /usr/local/lib/libjpeg.dylib
-- Building AfterImage library included in ROOT itself
-- Looking for GSL
-- Found GSL: /usr/local/Cellar/gsl/2.3/include (found suitable version "2.3", minimum required is "1.10")
-- Looking for Python
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.13")
-- Found Python interpreter version 2.7
-- Found PythonLibs: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib (found version "2.7.13")
-- Looking for OpenGL
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework
-- Looking for gl2ps
-- Could NOT find GL2PS (missing: GL2PS_LIBRARY GL2PS_INCLUDE_DIR)
-- gl2ps not found. Switching on builtin_gl2ps option
-- Looking for Graphviz
-- Found GRAPHVIZ: /usr/local/include
-- Looking for Bonjour
-- Checking whether Bonjour/Avahi is supported
-- Looking for Kerberos 5
-- Found KRB5: /usr/lib/libkrb5.dylib
-- Looking for LibXml2
-- Found LibXml2: /usr/lib/libxml2.dylib (found version "2.9.2")
-- Looking for OpenSSL
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
-- OpenSSL not found. Switching off ssl option
-- Looking for Castor
-- Could NOT find CASTOR (missing: CASTOR_shift_LIBRARY CASTOR_INCLUDE_DIR)
-- Castor not found. Switching off castor option
-- Looking for RFIO
-- Could NOT find CASTOR (missing: CASTOR_shift_LIBRARY CASTOR_INCLUDE_DIR)
-- Castor or DPM not found. Switching off rfio option
-- Looking for MySQL
-- Found MYSQL: /usr/local/Cellar/mysql/5.7.16/include/mysql
-- Looking for Oracle
-- Oracle not found.
-- Oracle: You can specify includes: -DORACLE_PATH_INCLUDES=/usr/include/oracle/10.2.0.3/client
-- currently found includes:
-- Oracle: You can specify libs: -DORACLE_PATH_LIB=/usr/lib/oracle/10.2.0.3/client/lib
-- currently found libs: ORACLE_LIBRARY_OCCI-NOTFOUND;ORACLE_LIBRARY_CLNTSH-NOTFOUND;ORACLE_LIBRARY_LNNZ-NOTFOUND
-- Oracle not found. Switching off oracle option
-- Looking for ODBC
-- Could NOT find ODBC (missing: ODBC_INCLUDE_DIR)
-- ODBC not found. Switching off odbc option
-- Looking for PostgreSQL
-- Found PostgreSQL: /usr/local/include
-- Looking for SQLite
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.1")
-- Found Sqlite: /usr/include
-- Looking for Pythia6
-- Pythia6 not found. Switching off pythia6 option
-- Looking for Pythia8
-- Could NOT find Pythia8 (missing: PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARY)
-- Pythia8 not found. Switching off pythia8 option
-- Looking for FFTW3
-- Found fftw3 includes at /usr/local/include
-- Found fftw3 library at /usr/local/lib/libfftw3.dylib
-- Looking for CFITSIO
-- Could NOT find CFITSIO (missing: CFITSIO_INCLUDE_DIR CFITSIO_LIBRARY)
-- CFITSIO not found. You can enable the option 'builtin_cfitsio' to build the library internally'
-- For the time being switching off 'fitsio' option
-- Support Shadow password not found. Switching off shadowpw option
-- Monalisa not found. Set variable MONALISA_DIR to point to your Monalisa installation
-- For the time being switching OFF 'monalisa' option
-- Looking for XROOTD
-- Found Xrootd version num: 4.5.0 (setting -DROOTXRDVERS=400050000)
-- libXrdMain not found: xproofd will be a wrapper around xrootd
-- include_dirs: /usr/local/include/xrootd;/usr/local/include/xrootd/private
-- libraries: /usr/local/lib/libXrdUtils.dylib;/usr/local/lib/libXrdClient.dylib;/usr/local/lib/libXrdCl.dylib
-- Could NOT find GFAL (missing: GFAL_INCLUDE_DIR SRM_IFCE_INCLUDE_DIR GFAL_LIBRARY)
-- GFAL library not found. Set variable GFAL_DIR to point to your gfal installation
and the variable SRM_IFCE_DIR to the srm_ifce installation
-- For the time being switching OFF 'gfal' option
-- Could NOT find DCAP (missing: DCAP_INCLUDE_DIR DCAP_LIBRARY)
-- dCap library not found. Set variable DCAP_DIR to point to your dCache installation
-- For the time being switching OFF 'dcache' option
-- Found LDAP: /usr/include
-- Could NOT find CHIRP (missing: CHIRP_INCLUDE_DIR CHIRP_LIBRARY)
-- chirp library not found. Set variable CHIRP_DIR to point to your chirp installation
-- For the time being switching OFF 'chirp' option
-- Could NOT find HDFS (missing: HDFS_INCLUDE_DIR HDFS_LIBRARY)
-- hdfs library not found. Set variable HDFS_DIR to point to your hdfs installation
-- For the time being switching OFF 'hdfs' option
-- Looking for DAVIX
-- Could NOT find DAVIX (missing: DAVIX_INCLUDE_DIR DAVIX_LIBRARY)
-- Davix not found. You can enable the option 'builtin_davix' to build the library internally'
-- For the time being switching off 'davix' option
-- >>> Option 'glite' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'sapdb' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'srp' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- Enabled support for: asimage astiff bonjour builtin_afterimage builtin_ftgl builtin_freetype builtin_gl2ps builtin_glew builtin_unuran builtin_llvm cxx11 libcxx cling cocoa exceptions explicitlink fftw3 fortran gviz gdml genvector krb5 ldap mathmore memstat minuit2 mysql opengl pch pgsql python roofit shared sqlite thread tmva xml xrootd
-- The ASM compiler identification is AppleClang
-- Found assembler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Found libtool - /usr/bin/libtool
-- Target triple: x86_64-apple-darwin16.1.0
-- Native target architecture is X86
-- Threads disabled.
-- Doxygen disabled.
-- Sphinx disabled.
-- Go bindings disabled.
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Targeting X86
-- Clang version: 3.9.0
-- Cling version (from VERSION file): ROOT_0.4~dev
-- Cling will look for C++ headers in '/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1' at runtime.
-- And if not found, will invoke: '/Library/Developer/CommandLineTools/usr/bin/c++ ' for them.
-- Performing Test CXX_HAS_fno_rtti
-- Performing Test CXX_HAS_fno_rtti - Success
-- Performing Test C_HAS_Wno_strict_overflow
-- Performing Test C_HAS_Wno_strict_overflow - Success
-- Performing Test C_HAS_Wno_maybe_uninitialized
-- Performing Test C_HAS_Wno_maybe_uninitialized - Failed
-- Performing Test CXX_HAS_Wno_shadow
-- Performing Test CXX_HAS_Wno_shadow - Success
-- Performing Test CXX_HAS_fno_strict_aliasing
-- Performing Test CXX_HAS_fno_strict_aliasing - Success
-- TMVA: Deactivate PyMVA because numpy is not found
-- Performing Test found_setresuid
-- Performing Test found_setresuid - Failed
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Failed
-- Performing Test found_stdexpstringview
-- Performing Test found_stdexpstringview - Success
-- Performing Test found_stod_stringview
-- Performing Test found_stod_stringview - Failed
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Failed
-- Performing Test found_stdinvoke
-- Performing Test found_stdinvoke - Failed

Also tried root_pandas:

f = root_pandas.read_root('Data/Mimac_Chamber3_20170111_094955_25keV.root','tree')
Error in TTreePlayer::UnbinnedFit: Unknown function: Data/Mimac_Chamber3_20170111_094955_25keV.root
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/root_pandas/readwrite.py", line 166, in read_root
arr = root2array(paths, key, all_vars, selection=where, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py", line 231, in root2array
warn_missing_tree)
File "root_numpy/src/tree.pyx", line 600, in _librootnumpy.root2array_fromfile (root_numpy/src/_librootnumpy.cpp:600)
IOError: unable to access tree 'tree' in Data/Mimac_Chamber3_20170111_094955_25keV.root

bash file:
. /Users/imor/Root/BuildPy2/bin/thisroot.sh
export PYTHONPATH=brew --prefix/lib/python2.7/site-packages:$PYTHONPATH

Ok, so this is now definitely a PyROOT (ROOT) problem. Your abort trap is because ROOT is built against the wrong python for some reason. See this root forum post for the common cause here. I believe all of these problems are due to the underlying issue with PyROOT.


Repeating what roda suggest from your link I get the following. But not sure if anything is wrong. Python seems to point to the right direction.

Is-MacBook-Pro:lib imor$ otool -L /Users/imor/Root/Py2Root/lib/libPyROOT.so
/Users/imor/Root/Py2Root/lib/libPyROOT.so:
@rpath/libPyROOT.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libTree.so (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
@rpath/libRIO.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libCore.so (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

Unsure if the LIBRARY paths should point to Root.

Is-MacBook-Pro:lib imor$ echo $DYLD_LIBRARY_PATH
/Users/imor/Root/Py2Root/lib
Is-MacBook-Pro:lib imor$ echo $LD_LIBRARY_PATH
/Users/imor/Root/Py2Root/lib

PATH points to:
/Users/imor/Root/Py2Root/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin
Maybe it should not point to /usr/bin?

Funny thing I found that locate root_numy points to /usr/local/lib/python3.6 which does not exist.

Maybe uninstalling brew and compiling ROOT with only system python or brew installing ROOT would help.

i would suggest brew install root6 to get that working. You might want to run brew doctor to make sure your system doesn't have any lingering issues (and I maintain the homebrew formula for root6).

brew did not solve it. Cleaning the bash files also did not help.
Reinstalling MacOS did it however. Works without problems.
I am gonna chalk it up to gremlins inside ROOT.

Ok, thanks!