0

I'm trying to run parallel computing. Hence I install package Rmpi.

install.packages("Rmpi")
require("Rmpi")

Could you please elaborate why there is such error message while I've just installed the package?

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into �C:/Users/Dung Le/Documents/R/win-library/4.0�
(as �lib� is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/Rmpi_0.6-9.zip'
Content type 'application/zip' length 353588 bytes (345 KB)
downloaded 345 KB

package ‘Rmpi’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\Dung Le\AppData\Local\Temp\RtmpGm7Riu\downloaded_packages
Loading required package: Rmpi
Error: package or namespace load failed for �Rmpi�:
 .onLoad failed in loadNamespace() for 'Rmpi', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object 'C:/Users/Dung Le/Documents/R/win-library/4.0/Rmpi/libs/x64/Rmpi.dll':
  LoadLibrary failure:  The specified module could not be found.

PS: I use Windows 10 Pro with version 2004 and build 19041.508. My R is 4.0.2.

r2evans
  • 141,215
  • 6
  • 77
  • 149
Akira
  • 2,594
  • 3
  • 20
  • 45
  • I've found directory paths with spaces in them to be problematic (see https://cran.r-project.org/bin/windows/base/rw-FAQ.html#How-do-I-install-R-for-Windows_003f), where `.../Dung Le/...` is the culprit. I suggest that you create another directory elsewhere without the space. (Preemptively: don't install packages in the library directory of the base R installation. Even if that doesn't have a space in it (default does), then it's still bad practice.) – r2evans Sep 19 '20 at 16:07
  • BTW, `require` is being used incorrectly here, see https://stackoverflow.com/a/51263513/3358272. – r2evans Sep 19 '20 at 16:10
  • 1
    @r2evans I've just change copy the library to another folder that has no name space. Then I use `.libPaths("C:/win-library/4.0")`. The error keeps appearing. I've checked and verified that the file `Rmpi.dll` does exists the folder `'C:/Users/Dung Le/Documents/R/win-library/4.0/Rmpi/libs/x64`. It's weirf. – Akira Sep 19 '20 at 16:48

0 Answers0