安裝過程參考 https://lightgbm.readthedocs.io/en/latest/Installation-Guide.htmlInstall
Git for Windows, CMake and MinGW-w64.
Run the following commands:
首先
git lightgbm
git clone --recursive https://github.com/Microsoft/LightGBM
然後
cmake -G "MinGW Makefiles" ..
然後
mingw32-make.exe -j4
安裝完成後 打開命令行 進去 Light GBM/python-package
第一個問題 :提醒要用64bit python 因爲 lightgbm
下載64bit python 將64bit python添加到環境變量中
然後 進去 Light GBM/python-package
運行 python setup.py install
第二個問題 運行完成後 import lightgbm 時候報錯
import lightgbm OSError: [WinError 193] %1 不是有效的 Win32 應用程序
此時將 64 bit python 路徑下面 Python\Python37-64\Lib\site-packages 文件夾下的 兩個文件夾
lightgbm 和 lightgbm-2.2.4-py3.7.egg-info(對應自己的版本)
拷貝到 32 bit python 路徑下面 Python\Python37-32\Lib\site-packages
刪除環境變量中 64bit python 對應的環境變量
使用32bit python 就可以正常使用 lightgbm