Unable to load any package in R (unable to load shared object)
Asked Answered
N

1

6

I have been using R for the last 2 years. I tried to start the program yesterday to run one of my scripts and the packages that I am using failed to load. I am not sure what happened as it was working fine earlier. I tried to uninstall and re-install the software but it wasn't of any help. Here's the error I get when I require()/library() a package (for example ggplot2):

>require(ggplot2)
Loading required package: ggplot2
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object '//mypath/myuser/data/Documents/R/win-library/3.2/digest/libs/x64/digest.dll':
  LoadLibrary failure:  Access is denied.

>library(ggplot2)
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
      unable to load shared object '//mypath/myuser/data/Documents/R/win-library/3.2/digest/libs/x64/digest.dll':
      LoadLibrary failure:  Access is denied.

I have found many people asking the same question on different websites, but their main problem was with a specific package. I am having this trouble with all packages. Any ideas how I can solve this problem? Much appreciated.

Naturally answered 4/5, 2015 at 16:1 Comment(4)
You probably need to describe your setup more completely. You seem to be trying to load a package from a shared network drive. Include: Version of OS, location of R and your package library, sessionInfo() should provide much of version of R, version of ggplot2, and the versions of the packages it imports: copied from my ggplot2 DESCRIPTION file) plyr (>= 1.7.1), digest, grid, gtable (>= 0.1.1), reshape2, scales (>= 0.2.3), proto, MASS. (One potential quick fix might be to delete your .Rdata and .Rhistory files and see if there is some corruption there.)Underling
@BondedDust, Thanks for your reply. Here's the information regarding the OS and the R version I am using: R version 3.2.0 (2015-04-16) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1.The description file of the ggplot2 gives the following infoabout imports Imports: plyr (>= 1.7.1), digest, grid, gtable (>= 0.1.1), reshape2, scales (>= 0.2.3), proto, MASS. I have tried to delete and re-install the whole software. It did not do the trick. Do you still think I should delete the .Rdata nd .Rhistory files? Thanks for your help.Naturally
It sounds more like a permissions problem which are notorious for bedeviling Windows users. It's always a good idea to delete .Rdata and .Rhistory files. So-called "dot-files" are invisible to the Windows Explorer interface by default and you need to change your device settings to "see" them. The process is not one I am familiar with as a non-Windows-user so search SuperUser.com for advice there on both that matter and the permissions concern..Underling
@BondedDust, Thanks for the hint. I was finally able to solve the problem. I will post the answer here in case someone in the future faced similar issue.Naturally
N
5

As BondedDust has explained in the comments, the problem has to do with the permissions that are given to users. I am connected to a network where the libraries are saved on a shared space. The issue was resolved by moving the default library to a local path. The process that needs to be followed to change the library to a local one is quite simple and it is mentioned in the second answer in this question on stackoverflow.

Naturally answered 5/5, 2015 at 16:22 Comment(1)
I am receiving the same error, but my .libpaths() is correct both before and after following this advice.Allometry

© 2022 - 2024 — McMap. All rights reserved.