Lightgbm OSError, Library not loaded

前端 未结 7 876
抹茶落季
抹茶落季 2021-02-13 03:03

If I simply do:

import lightgbm as lgb

I\'m getting

python script.py 
Traceback (most recent call last):
File \"script.py\", li         


        
7条回答
  •  执笔经年
    2021-02-13 03:18

    On MacOS High Sierra with MacPorts installed, I did the following:

    1. Install clang-5.0 using MacPorts
    2. Inside the /build directory, run cmake -DCMAKE_CXX_COMPILER=clang++-mp-5.0 -DCMAKE_C_COMPILER=clang-mp-5.0 ..
    3. To build the python package, go to /python_package directory and modify the setup.py script. You need to modify the function compile_cpp() at the very end that checks the case for other OS (including Mac). Before the silent_call(...), add the following two lines: cmake_cmd.append("-DCMAKE_CXX_COMPILER=clang++-mp-5.0") cmake_cmd.append("-DCMAKE_C_COMPILER=clang-mp-5.0")
    4. Run sudo python setup.py install. Enjoy

提交回复
热议问题