If I simply do:
import lightgbm as lgb
I\'m getting
python script.py
Traceback (most recent call last):
File \"script.py\", li
I find a similar problem here LightGBM
The answer and comment may help you.
Build LightGBM in Mac:
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
Then install:
cd ../python-packages
sudo python setup.py install --precompile
As stated by @ecodan, you might need to force Mac to use GCC and G++ instead of the default compiler. So instead of building with cmake ..
, try:
cmake -DCMAKE_C_COMPILER=/usr/local/Cellar/gcc/6.1.0/bin/gcc-6 -DCMAKE_CXX_COMPILER=/usr/local/Cellar/gcc/6.1.0/bin/g++-6 ..
ajusting the versions to match yours.