NatLabRockies / NatLabRockies/rdtools

xgboost on OSX

Open
#306 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
189
Forks
82
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Importing rdtools causes an error on mac when everything has been installed with pip

Full error message and traceback

---------------------------------------------------------------------------
XGBoostError                              Traceback (most recent call last)
<ipython-input-1-1cb1b3438ad7> in <module>()
      3 import numpy as np
      4 import pvlib
----> 5 import rdtools
      6 get_ipython().magic('matplotlib inline')

/Users/mdecegli/opt/anaconda3/envs/xgboost/lib/python3.7/site-packages/rdtools/__init__.py in <module>()
     10 from rdtools.aggregation import aggregation_insol
     11 from rdtools.clearsky_temperature import get_clearsky_tamb
---> 12 from rdtools.filtering import csi_filter
     13 from rdtools.filtering import poa_filter
     14 from rdtools.filtering import tcell_filter

/Users/mdecegli/opt/anaconda3/envs/xgboost/lib/python3.7/site-packages/rdtools/filtering.py in <module>()
      8 from numbers import Number
      9 import rdtools
---> 10 import xgboost as xgb
     11 
     12 # Load in the XGBoost clipping model using joblib.

/Users/mdecegli/opt/anaconda3/envs/xgboost/lib/python3.7/site-packages/xgboost/__init__.py in <module>()
      7 import os
      8 
----> 9 from .core import DMatrix, DeviceQuantileDMatrix, Booster, DataIter
     10 from .training import train, cv
     11 from . import rabit  # noqa

/Users/mdecegli/opt/anaconda3/envs/xgboost/lib/python3.7/site-packages/xgboost/core.py in <module>()
    201 
    202 # load the XGBoost library globally
--> 203 _LIB = _load_lib()
    204 
    205 

/Users/mdecegli/opt/anaconda3/envs/xgboost/lib/python3.7/site-packages/xgboost/core.py in _load_lib()
    192 
    193 Error message(s): {os_error_list}
--> 194 """)
    195     lib.XGBGetLastError.restype = ctypes.c_char_p
    196     lib.callback = _get_log_callback_func()

XGBoostError: 
XGBoost Library (libxgboost.dylib) could not be loaded.
Likely causes:
  * OpenMP runtime is not installed
    - vcomp140.dll or libgomp-1.dll for Windows
    - libomp.dylib for Mac OSX
    - libgomp.so for Linux and other UNIX-like OSes
    Mac OSX users: Run `brew install libomp` to install OpenMP runtime.

  * You are running 32-bit Python on a 64-bit OS

Error message(s): ['dlopen(/Users/mdecegli/opt/anaconda3/envs/xgboost/lib/python3.7/site-packages/xgboost/lib/libxgboost.dylib, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib\n  Referenced from: /Users/mdecegli/opt/anaconda3/envs/xgboost/lib/python3.7/site-packages/xgboost/lib/libxgboost.dylib\n  Reason: image not found']

To Reproduce
Install rdtools using pip on osx

Expected behavior
Import successful

possible solution
The error can be avoided by installing xgboost with conda. Perhaps we can catch the error and offer that suggestion.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the pip installation and import on macOS, then inspect rdtools/init.py and rdtools/filtering.py, where importing XGBoost triggers the reported failure. Confirm the behavior with the shown traceback and determine whether the resulting guidance or import behavior meets the expected successful import; no project tests are mentioned.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.