Mgcv import is not possible because Rlapack.dll was not found.

I want to link to the R statistical package in IronPython using the R.NET library. It works fine, but now I need to use the R mgcv library.

mgcv import mgcv (import is performed using the rdn.r.EagerEvaluate("library(mgcv)") , where rdn is the IronPython object that wraps the R.NET library). When the import fails, Windows opens a dialog box that says: "The program does not start because Rlapack.dll is missing on your computer. Try reinstalling the program to fix this problem."

Of course, R would never have worked if Rlapack.dll was missing, so what happens?

+4
source share
2 answers

I checked the mgcv package mgcv ; they include the base Matrix package. As it turned out, the Matrix team was compiled into a dll (found in $ {R_HOME} /library/Matrix/libs/i386/Matrix.dll) by the R development team. This dll needs to be linked to Rlapack.dll, which for some reason cannot find when R is called from R.NET in IronPython.

The solution was to remove the copy of Rlapack.dll (which you can find in $ {R_HOME} / bin / i386 /) in the same directory as Matrix.dll. Now every day is Sunday.

+3
source

I had the same problem with compositions.dll .

Therefore, instead of copying Rlapack.dll to the directory where compositions.dll exists, I added the bin directory to PATH .

 string rhome = System.Environment.GetEnvironmentVariable("R_HOME"); if (string.IsNullOrEmpty(rhome)) rhome = @"C:\Program Files\R\R-2.14.0"; System.Environment.SetEnvironmentVariable("R_HOME", rhome); System.Environment.SetEnvironmentVariable("PATH", System.Environment.GetEnvironmentVariable("PATH") + ";" + rhome + @"\bin\i386"); 
+2
source

Source: https://habr.com/ru/post/1379046/


All Articles