MAC에서 lightGBM 설치하기

John
3 min readMar 14, 2020

mac에서 lightGBM을 설치하다가 오류가 난 경험이 있어 기록을 해두려고 한다.

우선 해당 페이지에서 오피셜한 가이드를 따라했지만 계속 실패하는 바람에(ㅠㅠ) 구글링을 여러 차례 했고 나와 비슷한 오류를 경험한 유저들이 많아서 쉽게 문제를 해결할 수 있었다.

먼저 터미널 환경으로 들어간다.

pip install lightgbm

그리고 python에서 import를 하면 이런 오류를 볼 수 있다.

image not found라는 오류인데, 구글에 lightgbm을 검색했을 때 자동완성 검색어가 나올 정도로 흔한 설치상의 오류인 것 같았다.

1. 일단 구글링 해서 나온대로 따라해보기.

brew update 
brew upgrade
brew install gcc@8
git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM
export CXX=g++-8 CC=gcc-8
mkdir build
cd build
pip install cmake
cmake ..
make -j4
  • > 나는 이 과정을 진행 후 python에서 lightgbm을 import하니깐 동일한 Image not found 오류가 났다.

2. 재설치 후 다시 해보기

pip uninstall lightgbmgit clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBMexport CXX=g++-8 CC=gcc-8mkdir build ; cd buildcmake ..make -j4pip install --no-binary :all: lightgbm(python 접속)import lightgbm
  • > 해당 볼드 구문을 추가해서 진행하니 별 이상없이 import 가능했다!

참고

--

--