Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

package or namespace load failed for ‘lightgbm’ #1

Open
jbkunst opened this issue Jul 31, 2020 · 2 comments
Open

package or namespace load failed for ‘lightgbm’ #1

jbkunst opened this issue Jul 31, 2020 · 2 comments

Comments

@jbkunst
Copy link

jbkunst commented Jul 31, 2020

Hi! Thanks for this package.

In windows 10 I have an error when I try library(lightgbm). See the reprex for more detail.

Do you have some ideas to solve and install lightgbm?

Thanks in advance.

  
# devtools::install_github("curso-r/rightgbm")

library(rightgbm)

install_lightgbm()
#> Installing package into 'C:/Users/Joshua/Documents/R/win-library/3.6'
#> (as 'lib' is unspecified)
#> package 'lightgbm' successfully unpacked and MD5 sums checked

library(lightgbm)
#> Loading required package: R6
#> Error: package or namespace load failed for 'lightgbm' in inDL(x, as.logical(local), as.logical(now), ...):
#>  unable to load shared object 'C:/Users/Joshua/Documents/R/win-library/3.6/lightgbm/libs/x64/lib_lightgbm.dll':
#>   LoadLibrary failure:  No se puede encontrar el módulo especificado.

sessioninfo::session_info()
#> - Session info ---------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.6.3 (2020-02-29)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  Spanish_Latin America.1252  
#>  ctype    Spanish_Latin America.1252  
#>  tz       America/Santiago            
#>  date     2020-07-31                  
#> 
#> - Packages -------------------------------------------------------------------
#>  package     * version    date       lib source                           
#>  assertthat    0.2.1      2019-03-21 [1] CRAN (R 3.6.3)                   
#>  cli           2.0.2      2020-02-28 [1] CRAN (R 3.6.3)                   
#>  crayon        1.3.4.9000 2020-07-24 [1] Github (r-lib/crayon@dcf6d44)    
#>  curl          4.3        2019-12-02 [1] CRAN (R 3.6.3)                   
#>  data.table    1.13.0     2020-07-24 [1] CRAN (R 3.6.3)                   
#>  digest        0.6.25     2020-02-23 [1] CRAN (R 3.6.3)                   
#>  evaluate      0.14       2019-05-28 [1] CRAN (R 3.6.3)                   
#>  fansi         0.4.1      2020-01-08 [1] CRAN (R 3.6.3)                   
#>  glue          1.4.1      2020-05-13 [1] CRAN (R 3.6.3)                   
#>  highr         0.8        2019-03-20 [1] CRAN (R 3.6.3)                   
#>  htmltools     0.5.0      2020-06-16 [1] CRAN (R 3.6.3)                   
#>  httr          1.4.2      2020-07-20 [1] CRAN (R 3.6.3)                   
#>  jsonlite      1.7.0      2020-06-25 [1] CRAN (R 3.6.3)                   
#>  knitr         1.29       2020-06-23 [1] CRAN (R 3.6.3)                   
#>  lattice       0.20-41    2020-04-02 [1] CRAN (R 3.6.3)                   
#>  magrittr      1.5        2014-11-22 [1] CRAN (R 3.6.3)                   
#>  Matrix        1.2-18     2019-11-27 [2] CRAN (R 3.6.3)                   
#>  R6          * 2.4.1      2019-11-12 [1] CRAN (R 3.6.3)                   
#>  rightgbm    * 0.1.2      2020-07-31 [1] Github (curso-r/rightgbm@915d9ac)
#>  rlang         0.4.7      2020-07-09 [1] CRAN (R 3.6.3)                   
#>  rmarkdown     2.3        2020-06-18 [1] CRAN (R 3.6.3)                   
#>  sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 3.6.3)                   
#>  stringi       1.4.6      2020-02-17 [1] CRAN (R 3.6.2)                   
#>  stringr       1.4.0      2019-02-10 [1] CRAN (R 3.6.3)                   
#>  withr         2.2.0      2020-04-20 [1] CRAN (R 3.6.3)                   
#>  xfun          0.15       2020-06-21 [1] CRAN (R 3.6.3)                   
#>  yaml          2.2.1      2020-02-01 [1] CRAN (R 3.6.2)                   
#> 
#> [1] C:/Users/Joshua/Documents/R/win-library/3.6
#> [2] C:/Program Files/R/R-3.6.3/library

Created on 2020-07-31 by the reprex package (v0.3.0)

@Athospd
Copy link
Member

Athospd commented Aug 1, 2020

Hey @jbkunst , I couldn't reproduce your error. Just a hunch: maybe rtools related issue?

library(rightgbm)
install_lightgbm()
#> Installing package into 'D:/OneDrive/Documents/R/win-library/3.6'
#> (as 'lib' is unspecified)
#> package 'lightgbm' successfully unpacked and MD5 sums checked
#> Warning: cannot remove prior installation of package 'lightgbm'
#> Warning in file.copy(savedcopy, lib, recursive = TRUE): problem copying D:
#> \OneDrive\Documents\R\win-library\3.6\00LOCK\lightgbm\libs\x64\lib_lightgbm.dll
#> to D:\OneDrive\Documents\R\win-library\3.6\lightgbm\libs\x64\lib_lightgbm.dll:
#> Permission denied
#> Warning: restored 'lightgbm'
library(lightgbm)
#> Carregando pacotes exigidos: R6
sessioninfo::session_info()
#> - Session info ---------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.6.3 (2020-02-29)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  Portuguese_Brazil.1252      
#>  ctype    Portuguese_Brazil.1252      
#>  tz       America/Sao_Paulo           
#>  date     2020-08-01                  
#> 
#> - Packages -------------------------------------------------------------------
#>  ! package     * version date       lib source                           
#>    assertthat    0.2.1   2019-03-21 [1] CRAN (R 3.6.1)                   
#>    cli           2.0.2   2020-02-28 [1] CRAN (R 3.6.3)                   
#>    crayon        1.3.4   2017-09-16 [1] CRAN (R 3.6.1)                   
#>    curl          4.3     2019-12-02 [1] CRAN (R 3.6.3)                   
#>    data.table    1.12.8  2019-12-09 [1] CRAN (R 3.6.3)                   
#>    digest        0.6.25  2020-02-23 [1] CRAN (R 3.6.3)                   
#>    evaluate      0.14    2019-05-28 [1] CRAN (R 3.6.1)                   
#>    fansi         0.4.1   2020-01-08 [1] CRAN (R 3.6.2)                   
#>    glue          1.4.1   2020-05-13 [1] CRAN (R 3.6.3)                   
#>    highr         0.8     2019-03-20 [1] CRAN (R 3.6.1)                   
#>    htmltools     0.4.0   2019-10-04 [1] CRAN (R 3.6.2)                   
#>    httr          1.4.1   2019-08-05 [1] CRAN (R 3.6.3)                   
#>    jsonlite      1.7.0   2020-06-25 [1] CRAN (R 3.6.3)                   
#>    knitr         1.29    2020-06-23 [1] CRAN (R 3.6.3)                   
#>  D lattice       0.20-38 2018-11-04 [1] CRAN (R 3.6.1)                   
#>    lightgbm    * 2.3.2   2020-08-01 [1] local                            
#>    magrittr      1.5     2014-11-22 [1] CRAN (R 3.6.1)                   
#>  D Matrix        1.2-17  2019-03-22 [1] CRAN (R 3.6.1)                   
#>    R6          * 2.4.1   2019-11-12 [1] CRAN (R 3.6.2)                   
#>    Rcpp          1.0.5   2020-07-06 [1] CRAN (R 3.6.3)                   
#>    rightgbm    * 0.1.2   2020-07-11 [1] Github (curso-r/rightgbm@915d9ac)
#>    rlang         0.4.6   2020-05-02 [1] CRAN (R 3.6.3)                   
#>    rmarkdown     2.3     2020-06-18 [1] CRAN (R 3.6.3)                   
#>    sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.6.1)                   
#>    stringi       1.4.6   2020-02-17 [1] CRAN (R 3.6.2)                   
#>    stringr       1.4.0   2019-02-10 [1] CRAN (R 3.6.1)                   
#>    withr         2.2.0   2020-04-20 [1] CRAN (R 3.6.3)                   
#>    xfun          0.15    2020-06-21 [1] CRAN (R 3.6.3)                   
#>    yaml          2.2.1   2020-02-01 [1] CRAN (R 3.6.3)                   
#> 
#> [1] D:/OneDrive/Documents/R/win-library/3.6
#> [2] C:/Program Files/R/R-3.6.3/library
#> 
#>  D -- DLL MD5 mismatch, broken installation.

Created on 2020-08-01 by the reprex package (v0.3.0)

@alainaa
Copy link

alainaa commented Aug 29, 2020

Hello there!

I'm facing exactly the same issue. Don't think it has to do with my installed Rtools as I can install any package without any problem... Could you find a way to fix this? Thank you very much in advance!

library(rightgbm)
install_lightgbm()
Installing packages into ‘C:/Users/esabbaa0/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
probando la URL 'https://github.com/curso-r/lightgbm-build/releases/download/windows-r-3.6/lightgbm_2.3.2.zip'
Content type 'application/octet-stream' length 1180979 bytes (1.1 MB)
downloaded 1.1 MB
probando la URL 'https://github.com/curso-r/lightgbm-build/releases/download/windows-r-3.6/lightgbm_3.0.0-1.zip'
Content type 'application/octet-stream' length 1185838 bytes (1.1 MB)
downloaded 1.1 MB
probando la URL 'https://github.com/curso-r/lightgbm-build/releases/download/windows-r-3.6/lightgbm_3.0.0.zip'
Content type 'application/octet-stream' length 1197344 bytes (1.1 MB)
downloaded 1.1 MB
package ‘lightgbm’ successfully unpacked and MD5 sums checked
package ‘lightgbm’ successfully unpacked and MD5 sums checked
package ‘lightgbm’ successfully unpacked and MD5 sums checked
library(lightgbm)
Error: package or namespace load failed for ‘lightgbm’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Users/esabbaa0/Documents/R/win-library/3.6/lightgbm/libs/x64/lib_lightgbm.dll':
LoadLibrary failure: No se puede encontrar el módulo especificado.
Además: Warning message:
package ‘lightgbm’ was built under R version 3.6.3

NB: just to confirm that 'C:/Users/esabbaa0/Documents/R/win-library/3.6/lightgbm/libs/x64/lib_lightgbm.dll' is really there: 1.821Kb...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants