DeepLearnPhysics / larcv3

Third version of larcv. This is a complete replacement for larcv2.
MIT License
11 stars 6 forks source link

cannot import larcv in ubuntu #26

Closed mmajewsk closed 5 years ago

mmajewsk commented 5 years ago

Hi,

I would like to use this packae but I have the following problem:

Traceback (most recent call last):
  File "/home/mwm/anaconda3/lib/python3.6/site-packages/larcv-3.0a1-py3.6-linux-x86_64.egg/larcv/larcv.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/home/mwm/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: libhdf5_cpp.so.103: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/mwm/anaconda3/lib/python3.6/site-packages/larcv-3.0a1-py3.6-linux-x86_64.egg/larcv/__init__.py", line 2, in <module>
    from . import larcv
  File "/home/mwm/anaconda3/lib/python3.6/site-packages/larcv-3.0a1-py3.6-linux-x86_64.egg/larcv/larcv.py", line 17, in <module>
    _larcv = swig_import_helper()
  File "/home/mwm/anaconda3/lib/python3.6/site-packages/larcv-3.0a1-py3.6-linux-x86_64.egg/larcv/larcv.py", line 16, in swig_import_helper
    return importlib.import_module('_larcv')
  File "/home/mwm/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_larcv'

The libhdf5_cpp.so.103 actually exists and is in my python installation.

coreyjadams commented 5 years ago

I think this is a quirk of conda: you don't actually get the library path in your environment. It looks like you could do:

export LD_LIBRARY_PATH=/home/mwm/anaconda3/lib/:$LD_LIBRARY_PATH and it might work. Is that the location of the file libhdf5_cpp.so.103? If not, add the containing folder to your ld library path and I think it will work.

mmajewsk commented 5 years ago

@coreyjadams thanks, it actually works :D