radujica / baloo

The bare necessities of Pandas on the Weld runtime
BSD 3-Clause "New" or "Revised" License
14 stars 7 forks source link

OSError when importing baloo #24

Open williamma12 opened 5 years ago

williamma12 commented 5 years ago

I am on MacOS 10.14 and python 3.6

I tried doing import baloo as bl from a pip install baloo and building it from the source using pip install -e . in the baloo repo root directory. The traceback from the two installed versions are slightly different and are below.

Traceback from installing from pip:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-7e2e78d40dae> in <module>
----> 1 import baloo

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/__init__.py in <module>
----> 1 from .core import *
      2 from .functions import *
      3 from .io.parsers import *

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/core/__init__.py in <module>
----> 1 from .frame import DataFrame
      2 from .indexes import *
      3 from .series import Series
      4 
      5 # TODO: perhaps add 'release' mode to disable type checks -O ~ __debug__

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/core/frame.py in <module>
      6 
      7 from .generic import BinaryOps, BalooCommon
----> 8 from .indexes import Index, MultiIndex
      9 from .series import Series, _series_slice, _series_filter, _series_element_wise_op, _series_agg, _series_tail, \
     10     _series_iloc, _series_iloc_with_missing, _series_from_pandas

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/core/indexes/__init__.py in <module>
----> 1 from .base import Index
      2 from .multi import MultiIndex
      3 from .range import RangeIndex

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/core/indexes/base.py in <module>
      2 
      3 from ..generic import BinaryOps, IndexCommon, BalooCommon, BitOps
----> 4 from ...core.utils import check_type, infer_dtype, is_scalar, check_weld_bit_array, check_valid_int_slice, \
      5     convert_to_numpy, check_dtype
      6 from ...weld import LazyArrayResult, numpy_to_weld_type, weld_filter, weld_slice, \

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/core/utils.py in <module>
      1 import numpy as np
      2 
----> 3 from ..weld import WeldObject, weld_count, WeldBit, WeldLong, LazyResult, supported_dtype_chars
      4 
      5 

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/__init__.py in <module>
      1 from .cache import Cache
----> 2 from .convertors import *
      3 from .lazy_result import *
      4 from .pyweld import *
      5 from .weld_aggs import *

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/convertors/__init__.py in <module>
----> 1 from .encoders import NumPyEncoder, NumPyDecoder, numpy_to_weld_type, weld_to_numpy_dtype, \
      2     default_missing_data_literal, supported_dtype_chars

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/convertors/encoders.py in <module>
      3 import numpy as np
      4 
----> 5 from .utils import to_weld_vec
      6 from ..pyweld.types import *
      7 from ..pyweld.weldobject import WeldObjectDecoder, WeldObjectEncoder, cweld

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/convertors/utils.py in <module>
      1 import sys
      2 
----> 3 from ..pyweld.types import WeldVec
      4 
      5 

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/pyweld/__init__.py in <module>
      1 from .types import WeldLong, WeldBit, WeldDouble, WeldFloat, WeldInt, WeldInt16, WeldChar, WeldVec, WeldStruct
----> 2 from .weldobject import WeldObject

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/pyweld/weldobject.py in <module>
      4 import time
      5 
----> 6 from . import bindings as cweld
      7 from .types import *
      8 

~/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/pyweld/bindings.py in <module>
      5 
      6 # Implements a wrapper around the Weld API.
----> 7 weld = CDLL(WELD_PATH, mode=RTLD_GLOBAL)
      8 
      9 

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    346 
    347         if handle is None:
--> 348             self._handle = _dlopen(self._name, mode)
    349         else:
    350             self._handle = handle

OSError: dlopen(/Users/William/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/libs/libweld.so, 10): no suitable image found.  Did find:
    /Users/William/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/libs/libweld.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
    /Users/William/Documents/weld/venv3/lib/python3.6/site-packages/baloo/weld/libs/libweld.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00

Traceback from installing from source:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-5-7e2e78d40dae> in <module>
----> 1 import baloo

~/Documents/baloo/baloo/__init__.py in <module>
----> 1 from .core import *
      2 from .functions import *
      3 from .io.parsers import *

~/Documents/baloo/baloo/core/__init__.py in <module>
----> 1 from .frame import DataFrame
      2 from .indexes import *
      3 from .series import Series
      4 
      5 # TODO: perhaps add 'release' mode to disable type checks -O ~ __debug__

~/Documents/baloo/baloo/core/frame.py in <module>
      6 
      7 from .generic import BinaryOps, BalooCommon
----> 8 from .indexes import Index, MultiIndex
      9 from .series import Series, _series_slice, _series_filter, _series_element_wise_op, _series_agg, _series_tail, \
     10     _series_iloc, _series_iloc_with_missing, _series_from_pandas

~/Documents/baloo/baloo/core/indexes/__init__.py in <module>
----> 1 from .base import Index
      2 from .multi import MultiIndex
      3 from .range import RangeIndex

~/Documents/baloo/baloo/core/indexes/base.py in <module>
      2 
      3 from ..generic import BinaryOps, IndexCommon, BalooCommon, BitOps
----> 4 from ...core.utils import check_type, infer_dtype, is_scalar, check_weld_bit_array, check_valid_int_slice, \
      5     convert_to_numpy, check_dtype
      6 from ...weld import LazyArrayResult, numpy_to_weld_type, weld_filter, weld_slice, \

~/Documents/baloo/baloo/core/utils.py in <module>
      1 import numpy as np
      2 
----> 3 from ..weld import WeldObject, weld_count, WeldBit, WeldLong, LazyResult, supported_dtype_chars
      4 
      5 

~/Documents/baloo/baloo/weld/__init__.py in <module>
      1 from .cache import Cache
----> 2 from .convertors import *
      3 from .lazy_result import *
      4 from .pyweld import *
      5 from .weld_aggs import *

~/Documents/baloo/baloo/weld/convertors/__init__.py in <module>
----> 1 from .encoders import NumPyEncoder, NumPyDecoder, numpy_to_weld_type, weld_to_numpy_dtype, \
      2     default_missing_data_literal, supported_dtype_chars

~/Documents/baloo/baloo/weld/convertors/encoders.py in <module>
      3 import numpy as np
      4 
----> 5 from .utils import to_weld_vec
      6 from ..pyweld.types import *
      7 from ..pyweld.weldobject import WeldObjectDecoder, WeldObjectEncoder, cweld

~/Documents/baloo/baloo/weld/convertors/utils.py in <module>
      1 import sys
      2 
----> 3 from ..pyweld.types import WeldVec
      4 
      5 

~/Documents/baloo/baloo/weld/pyweld/__init__.py in <module>
      1 from .types import WeldLong, WeldBit, WeldDouble, WeldFloat, WeldInt, WeldInt16, WeldChar, WeldVec, WeldStruct
----> 2 from .weldobject import WeldObject

~/Documents/baloo/baloo/weld/pyweld/weldobject.py in <module>
      4 import time
      5 
----> 6 from . import bindings as cweld
      7 from .types import *
      8 

~/Documents/baloo/baloo/weld/pyweld/bindings.py in <module>
      5 
      6 # Implements a wrapper around the Weld API.
----> 7 weld = CDLL(WELD_PATH, mode=RTLD_GLOBAL)
      8 
      9 

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    346 
    347         if handle is None:
--> 348             self._handle = _dlopen(self._name, mode)
    349         else:
    350             self._handle = handle

OSError: dlopen(/Users/William/Documents/baloo/baloo/weld/libs/libweld.so, 10): image not found
radujica commented 5 years ago

Hey @williamma12 , apologies for the delay. This issue is most likely because the Weld inside Baloo has been built for Linux atm.

Making it work should require building Weld on Mac, adding the Weld binary in baloo/weld/libs, and updating baloo/config.py for correct file name.

Creating a PR which makes it work on both linux and mac would be welcomed :) Weld had something similar here, however the pypi publishing could be more complicated.