OS Error: dlopen ... Reason: image not found
Closed this issue · 0 comments
kumikoda commented
System
- 2017 Macbook Pro 15-inch
- macOS Big Sur v11.5.2
- python 3.7.9
Problem
(venv) anson ~/numerai/example-scripts (master)
$ python3 example_model.py
Traceback (most recent call last):
File "example_model.py", line 2, in <module>
from lightgbm import LGBMRegressor
File "/Users/anson/numerai/example-scripts/venv/lib/python3.7/site-packages/lightgbm/__init__.py", line 8, in <module>
from .basic import Booster, Dataset, register_logger
File "/Users/anson/numerai/example-scripts/venv/lib/python3.7/site-packages/lightgbm/basic.py", line 95, in <module>
_LIB = _load_lib()
File "/Users/anson/numerai/example-scripts/venv/lib/python3.7/site-packages/lightgbm/basic.py", line 86, in _load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 442, in LoadLibrary
return self._dlltype(name)
File "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/anson/numerai/example-scripts/venv/lib/python3.7/site-packages/lightgbm/lib_lightgbm.so, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
Referenced from: /Users/anson/numerai/example-scripts/venv/lib/python3.7/site-packages/lightgbm/lib_lightgbm.so
Reason: image not found
Solution
brew install libomp
microsoft/LightGBM#1369