scikit-hep/root_numpy

ROOT 6.10/02 and root_numpy compatibility

hareyakana opened this issue · 8 comments

I am trying to pip install root_pandas and one of the dependency is root_numpy

However some weird reasons I am unable to install it even though I can import ROOT in python. I am working on python3.6 as I am more comfortable with it.

Is root_numpy is not yet compatible with the latest ROOT?

ndawe commented

@hareyakana yes it should be compatible with the latest ROOT. I've tested up to v6-10-00. I'll try v6-10-02 soon. What do you see when you try to pip install root_numpy?

Collecting root_numpy
  Using cached root_numpy-4.7.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/tmp/pip-build-4mk05ax_/root-numpy/setup.py", line 68, in <module>
        root_version = root_version_installed()
      File "<string>", line 104, in root_version_installed
      File "/usr/lib64/python3.6/subprocess.py", line 707, in __init__
        restore_signals, start_new_session)
      File "/usr/lib64/python3.6/subprocess.py", line 1326, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: 'root-config'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-4mk05ax_/root-numpy/setup.py", line 73, in <module>
        "root-config is not in PATH and ROOTSYS is not set. "
    RuntimeError: root-config is not in PATH and ROOTSYS is not set. Is ROOT installed correctly?
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4mk05ax_/root-numpy/

Well I am on centos7. I did build ROOT with python3 support. I did check that I am able to import ROOT in python3.

I have seen this error as well, the crucial line is here:

RuntimeError: root-config is not in PATH and ROOTSYS is not set. Is ROOT installed correctly?

Have you sourced thisroot.sh in your root installation directory, as described here under step 6 when you try to install root_pandas?
Maybe setting ROOTSYS and PATH manually would help? ROOTSYS should be the base directory of your ROOT installation and you want to add ROOTSYS/bin to your PATH.

hmmm. I did sourced thisroot.sh and even manually checked the ROOTSYS and PATH.
It still gives the same error.

hmmm. I did sourced thisroot.sh and even manually checked the ROOTSYS and PATH.
It still gives the same error.

What happens when you run python3 -c "import ROOT" after sourcing?

I have no problem import ROOT in my python console. It is working fine so far when I use import ROOT for my other python script. All this was in python3

another note, I tried installing from source and pip both gave the same error as I quote earlier.

Hi I think figured where my problem was.

I think linking the to libpython3.xm.so when building root might cause it failed to install via pip. linking to libpython3.x.so fixed the issue with pip install root_numpy.