mac(m1 pro晶片)上解決安裝Lightgbm庫失敗問題

helloHKTK發表於2024-05-30

報錯日誌

執行pip install lightgbm時報錯:

Could not find compiler set in environment variable CC:

        gcc-8.
      Call Stack (most recent call first):
        CMakeLists.txt:32 (project)


      CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
      CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
      -- Configuring incomplete, errors occurred!

解決方法

conda install -c conda-forge lightgbm

網上其他方法

brew install cmake
brew install gcc --without-multilib
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
export CXX=g++-8 CC=gcc-8
mkdir build ; cd build
cmake ..
make -j4
pip install lightgbm

相關文章