mac(m1 pro芯片)上解决安装Lightgbm库失败问题

报错日志

执行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
posted @ 2024-05-30 23:00  helloHKTK  阅读(74)  评论(0编辑  收藏  举报