windows下安装LightGBM

来源:互联网 发布:大数据 临床数据中心 编辑:程序博客网 时间:2024/06/05 11:12

Install git for windows, cmake and MinGW64.

Run following command:

  

git clone --recursive https://github.com/Microsoft/LightGBMcd LightGBMmkdir buildcd buildcmake -G "MinGW Makefiles" ..mingw32-make.exe -j
   

ERROR:

  1、执行 命令报错

make -G "MinGW Makefiles" ..

   环境变量中加入了 git文件下的sh.exe的路径,在环境变量中没有发现此路径,执行命令 where sh.exe,确实有路径,但是系统环境变量中确实没有发现。D:\soft\Git\usr\bin\sh.exe

  2、 google了下 

环境变量中配置了`D:\Program Files (x86)\Git\bin`,该目录下存在一个`sh.exe`
在执行make命令时,如果在`MakeFile`文件中没有指定shell的路径,`make`就会到环境变量中,去找一个`X:\\XXX\XXX\sh.exe`作为它的默认shell作者解决方法
          在`MakeFile`文件最初的位置,添加:
          SHELL=C:/Windows/System32/cmd.exe 3、按照作者方法去做,找到docs下的makefiles文件加入上面那句,执行命令
     make -G "MinGW Makefiles" ..
4、还是报调用sh.exe错误,打开build文件下的CMakeCache文件 把里面的D:/xx/xx/uxx/bin/sh.exe路径替换为
     C:/Windows/System32/cmd.exe。 5、继续执行命令  
     make -G "MinGW Makefiles" ..      错误解除  6、继续执行命令
     mingw32-make.exe -j     安装成功  7、进入 python-pakage 
     执行 python setup.py install  8、执行命令
     import lightgbm as lgb     没有报错则安装成功







    

原创粉丝点击