JupyterHub and CERN ROOT, Python3 MAC-OSX: root_numpy issue

I have successfully installed JupyterHub with CERN ROOT, Python3 on MAC-OSX but I’am in trouble with the installation of root_numpy package, perfectly working in Jupyter notebook (on the same machine) and but giving the following error on JupyterHub:

ImportError Traceback (most recent call last)
in
----> 1 import root_numpy as rtnp

/usr/local/root/lib/ROOT.py in _importhook(name, *args, **kwds)
531 except Exception:
532 pass
–> 533 return _orig_ihook( name, *args, **kwds )
534
535 builtin.import = _importhook

~/Library/Python/3.7/lib/python/site-packages/root_numpy/init.py in
49 del numpy_version_at_install
50
—> 51 from ._tree import (
52 root2array, root2rec,
53 tree2array, tree2rec,

/usr/local/root/lib/ROOT.py in _importhook(name, *args, **kwds)
531 except Exception:
532 pass
–> 533 return _orig_ihook( name, *args, **kwds )
534
535 builtin.import = _importhook

~/Library/Python/3.7/lib/python/site-packages/root_numpy/_tree.py in
4
5 from .extern.six import string_types
----> 6 from . import _librootnumpy
7
8

/usr/local/root/lib/ROOT.py in _importhook(name, *args, **kwds)
531 except Exception:
532 pass
–> 533 return _orig_ihook( name, *args, **kwds )
534
535 builtin.import = _importhook

ImportError: dlopen(/Users/mazzitel/Library/Python/3.7/lib/python/site-packages/root_numpy/_librootnumpy.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libGraf3d.so
Referenced from: /Users/mazzitel/Library/Python/3.7/lib/python/site-packages/root_numpy/_librootnumpy.cpython-37m-darwin.so
Reason: image not found

any help?

by the way my tread to successfully install all the package was
warning: do not use anaconda! https://sft.its.cern.ch/jira/browse/ROOT-9033
Install python3
install Xcode
install CMake
install XQuartz
cd /usr/local/
sudo git clone --depth 1 https://github.com/root-mirror/root.git
sudo chown -R (whoami):(id -g -n $(whoami)) root
cd root
cd build
cmake -Dpython=ON -Droofit=ON -DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/root …
make -j8
sudo make install

pip3 install --upgrade pip
pip3 install jupyter


sudo npm install -g configurable-http-proxy
pip3 install jupyterhub

Do you have any environment variables set, e.g. PYTHONPATH, or DYLD_LIBRARY_PATH? Check out the output of:

env | sort | grep PATH

It’s possible that you have set an environment variable in your profile that’s required for this to work, that doesn’t end up inherited by the JupyterHub environment.

yes, I have! this is the output of my PATH environment
CMAKE_PREFIX_PATH=/usr/local/root

JUPYTER_PATH=/usr/local/root/etc/notebook

LIBPATH=/usr/local/root/lib

MANPATH=/usr/local/root/man:/usr/local/share/man:/usr/share/man:/opt/X11/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man

PATH=/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/root/bin:/Users/mazzitel/Library/Python/2.7/bin/:/Applications/CMake.app/Contents/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

PYTHONPATH=/usr/local/root/lib

SHLIB_PATH=/usr/local/root/lib

PYTHONPATH is not inherited by jupyterhub subprocesses. You may want to add

c.Spawner.environment['PYTHONPATH'] = '/usr/local/root/lib'

to your jupyterhub_config.py

Thanks Minrk, looks that directive actually is c.Spawner.environment ={ ‘PYTHONPATH’ : ‘/usr/local/root/lib’} but is still giving me error