问题描述
我尝试了其他方法来安装lightgbm
软件包,但无法完成.我在 github存储库中尝试了所有方法,但是它们不起作用.我运行Windows 10和R 3.5(64位).有有人也有类似的问题.所以我尝试了他的解决方案:
I have tried different things to install the lightgbm
package but I can´t get it done. I tried all methods at the github repository but they don't work.I run Windows 10 and R 3.5 (64 bit). There is someone with similar problems. So I tried his solution:
- 安装cmake(64位)
- 安装Visual Studio(2017)
- 安装Rtools(64位)
- 将系统变量中的路径更改为"C:\ Program"Files \ CMake \ bin \ cmake;"
- Changing Path in the System Variables to "C:\ProgramFiles\CMake\bin\cmake;"
- 使用预编译的dll/lib安装lightgbm
->
devtools::install_github("Laurae2/lgbdl", force = TRUE)
library(lgbdl)
lgb.dl(commit = "master",
compiler = "vs",
repo = "https://github.com/Microsoft/LightGBM")
*** arch - i386
installing via 'install.libs.R' to C:/Users/X1/Documents/R/win-
library/3.5/lightgbm
Error in eval(ei, envir) : Cannot find lib_lightgbm.dll
* removing 'C:/Users/XXX/Documents/R/win-library/3.5/lightgbm'
In R CMD INSTALL
installation of package
�C:/Users/XXX/AppData/Local/Temp/RtmpczNLaN/LightGBM/R-package� had non-
zero exit status[1] FALSE
有什么办法解决这个问题吗?
Any idea how to fix this?
推荐答案
它对我有用,希望对您有所帮助.
It works for me, hope it helps.
-
确保您安装了所有必需软件
Make sure you install all mandatory software
从 https://github.com/Microsoft/LightGBM下载预编译的.dll文件/版本并将其放入.\ LightGBM \
Download the precomplied .dll file from https://github.com/Microsoft/LightGBM/releasesand put it in .\LightGBM\
在install.libs.R中,设置use_precompile<-TRUE
In install.libs.R, set use_precompile <- TRUE
将CMakeLists.txt从根目录复制到.\ LightGBM \ R-package \ inst \ bin
Copy CMakeLists.txt from root directory into .\LightGBM\R-package\inst\bin
在R控制台中,输入:install.packages(file.path("C:\ yourdirectory \","LightGBM","R-package"),repos = NULL,类型="source")
In R console type:install.packages(file.path("C:\yourdirectory\", "LightGBM", "R-package"), repos = NULL, type = "source")
这篇关于在R中安装lightgbm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!