The specified module could not be found in R

别来无恙 提交于 2019-12-23 12:50:04

问题


I am developing a package using Rcpp and another third party C++ library. When I tried to install the package, I got

Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'C:/Users/Admin/Documents/R/win-library/2.15/packagename/libs/i386/package.dll':
   LoadLibrary failure:  The specified module could not be found.

In 32-bit Windows OS, following an advice from my colleague, I fixed the problem by adding location of following dlls from MingW to system path.

libgcc_s_dw2-1.dll

But 64-bit Windows, I get the same error even with the dll although I am using 32-bit R.

So my question:

Is there any way to know why The specified module could not be found error occurs? I mean I would like to know which module is missing. Maybe verbose option some where?


回答1:


There is not an easy way in R to get more information from the error I mentioned. But I found free software to find which dependency the dill is missing by following web site: http://www.dependencywalker.com/

Using the software I was able to find following dlls are needed to be in system path.

GPSVC.dll
IESHIMS.dll
SYSNIFY.dll



回答2:


As hinted by the post Win 7, 64 bit, dll problems, the output of dependencywalker may be misleading. In my case, the path to "Microsoft SQL Server" was missing in my system %PATH% environment variable (deliberately removed, because it seemed unnecessary). After that the LoadLibrary error vanished and the library loaded.




回答3:


I belive you can Run you R software as Administrator you can solve your problem... You may check: Unable to load any package in R (unable to load shared object)




回答4:


I ran into this same problem and the issue turned out to be that Windows was not looking in the right place for jvm.dll. Solution was to add location of this dll to Windows PATH variable.

Found solution here: Using the rJava package on Win7 64 bit with R

Instructions on how to edit PATH variable here: https://www.java.com/en/download/help/path.xml




回答5:


I was also facing the error

"Warning in install.packages : installation of package ‘rlang’ had non-zero exit status".

I followed the following steps

  1. restart the RStudio,
  2. install.packages("tidyverse")
  3. removed the folder C:/Users/CHILIKA/Documents/R/win-library/3.5/00LOCK-rlang

and again

  1. install.packages("rlang") then rlang sucessfully installed.


来源:https://stackoverflow.com/questions/13497222/the-specified-module-could-not-be-found-in-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!