Sunday, March 5, 2023

Solving lightgbm errors on Mac

Lightgbm OSError, Library not loaded


elf._handle = _dlopen(self._name, mode)

OSError: dlopen(/usr/local/lib/python2.7/site-packages/lightgbm/lib_lightgbm.so, 6): Library not loaded: /usr/local/opt/gcc/lib/gcc/7/libgomp.1.dylib

Referenced from: /usr/local/lib/python2.7/site-packages/lightgbm/lib_lightgbm.so

Reason: image not found


There were a couple of solutions provided


brew install libomp


OR 


brew install cmake  

brew install gcc --without-multilib  

git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM  

mkdir build ; cd build  

cmake ..   

make -j  


cd ../python-packages  

sudo python setup.py install --precompile


OR 

conda install lightgbm


The one that worked for me was 


conda install lightgbm


 

References:

https://stackoverflow.com/questions/44937698/lightgbm-oserror-library-not-loaded

No comments:

Post a Comment