天天看點

在win10 64位系統下安裝 LightGBM

安裝過程參考 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

繼續閱讀