scikit-hep / root_pandas

A Python module for conveniently loading/saving ROOT files as pandas DataFrames
MIT License
109 stars 35 forks source link

Installing root_pandas on lxplus #71

Closed fdesse closed 6 years ago

fdesse commented 6 years ago

In prevision of the upcoming lhcb starterkit, I tried to install root_pandas on lxplus using the instructions on the starterkit webpage.

I get the following error.

(test-venv2) [fadesse@lxplus029 ~]$ python -m pip install --user --no-binary root_numpy root_pandas
Collecting root_pandas
  Using cached https://files.pythonhosted.org/packages/de/c1/ab626834bf8821c3acc7051ded702d2eb8edac85115d8177f39e9324797f/root_pandas-0.6.0.tar.gz
Collecting numpy (from root_pandas)
  Using cached https://files.pythonhosted.org/packages/14/1c/546724245c8b3aad39d807a0bed14a37b39943860c6b34456a363076c65b/numpy-1.15.2-cp34-cp34m-manylinux1_x86_64.whl
Collecting pandas>=0.18.0 (from root_pandas)
  Using cached https://files.pythonhosted.org/packages/08/01/803834bc8a4e708aedebb133095a88a4dad9f45bbaf5ad777d2bea543c7e/pandas-0.22.0.tar.gz
  Installing build dependencies ... done
Collecting root_numpy (from root_pandas)
  Using cached https://files.pythonhosted.org/packages/d7/44/4165539b7a62de78e56cd7520fd79d19a07ab6fc7b6ccb581044eee5aca1/root_numpy-4.7.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/tmp/fadesse/pip-install-kpvpn5p6/root-numpy/setup.py", line 59, in <module>
        root_version = root_version_installed(root_config)
      File "<string>", line 104, in root_version_installed
      File "/usr/lib64/python3.4/subprocess.py", line 856, in __init__
        restore_signals, start_new_session)
      File "/usr/lib64/python3.4/subprocess.py", line 1464, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: 'bin/root-config'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/fadesse/pip-install-kpvpn5p6/root-numpy/setup.py", line 65, in <module>
        rootsys, root_config))
    RuntimeError: ROOTSYS is  but running bin/root-config failed

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/fadesse/pip-install-kpvpn5p6/root-numpy/

I think its related to root_numpy and ROOT.

I previously updated pip and setuptools (just in case). Not updating them gives the same result.

I use the default lxplus7 settings with python3 (in a venv, but I don't think this makes any difference):

(test-venv2) [fadesse@lxplus029 ~]$ which python
~/test-venv2/bin/python
(test-venv2) [fadesse@lxplus029 ~]$ python --version
Python 3.4.9
(test-venv2) [fadesse@lxplus029 ~]$ which root
/usr/bin/root
(test-venv2) [fadesse@lxplus029 ~]$ pip list
Package    Version
---------- -------
pip        18.0   
setuptools 40.4.3 

Thx for your help ! :)

chrisburr commented 6 years ago

I think the issue is that you don't have ROOT installed for your Python installation. You can try import ROOT from Python to check, if it gives ImportError: No module named ROOT then this is the issue.

How did you install/setup Python 3?

fdesse commented 6 years ago

That is correct, ROOT is not installed in my Python installation.

I very naively did python3 -m venv my-venv, thinking that it would take the default Python 3 installed on lxplus. I also asumed (I was wrong it seems) that ROOT would be installed there by default.

chrisburr commented 6 years ago

As there is still no good way to install ROOT, I suggest you use an "LCG view" on lxplus:

source /cvmfs/sft.cern.ch/lcg/views/setupViews.sh LCG_93python3 x86_64-slc6-gcc62-opt
# LCG_93python3 doesn't provide a python binary so alias it instead
alias python=python3

I think there were some "quirks" to using virtualenv with LCG views but I forget the details.

chrisburr commented 6 years ago

Just to add, if you use virtualenv you don't need the --user flag with pip as the default is to install to the virtualenv.

fdesse commented 6 years ago

Many thanks, I will try this. I will try to use a venv still (and post the way to do it here if I succed). I like the safety of being able to break stuff and then just leave the venv :)