1

I have tried to load the library(tidyverse). However, I got an error like:

Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): namespace ‘tibble’ 2.1.3 is already loaded, but >= 3.0.0 is required

I have followed what everyone is suggesting:

remove.package("tibble") 
install.packages("tibble")

However, I get this error:

Warning in install.packages :
  cannot remove prior installation of package ‘tibble’
Warning in install.packages :
  problem copying D:\Rlibraries\00LOCK\tibble\libs\x64\tibble.dll to D:\Rlibraries\tibble\libs\x64\tibble.dll: Permission denied
Warning in install.packages :
  restored ‘tibble’

I see a problem in the path - "D:\Rlibraries\00LOCK\tibble\..."

I check my .libPaths() as others suggested on stackoverflow. I get this:

[1] "D:/Rlibraries"                      "C:/Program Files/R/R-3.6.3/library"

I believe the issue lies in the path - "D:/Rlibraries/00LOCK" because my defaulted library is "D:/Rlibraries".

Does someone know why this is occuring and how to solve this mistery? I never had this issue before.

GaB
  • 1,076
  • 2
  • 16
  • 29
  • 1
    Try to stop RStudio / R and delete manually the `\00LOCK\` directory – Waldi Sep 10 '20 at 12:24
  • this is actually my issue. I wanted to delete manualy the 00LOCK directory but I do not find along the path when I am going into my main directory – GaB Sep 10 '20 at 12:27
  • 1
    Perhaps stopping RStudio solved the lock problem : could you try the install again? – Waldi Sep 10 '20 at 12:29
  • it did solve the issue but now my RStudio fattaly shuts down? – GaB Sep 10 '20 at 12:40
  • Next step is perhaps to restart the PC, win mysteries ;) – Waldi Sep 10 '20 at 12:41
  • well, mysteries with R are so many. I have found the reason why it does. I am working within a project, and maybe when I load the data, it is big one, it shuts down. If I do it out of the project then it works. Do you want to put your response as an answer? – GaB Sep 10 '20 at 12:53
  • Good news! Thanks for proposing our discussion as an answer, but I prefer to close the question as duplicate of : https://stackoverflow.com/q/14382209/13513328 – Waldi Sep 10 '20 at 12:59
  • well, similar but not the same? – GaB Sep 10 '20 at 13:01
  • Actually you're right : I post an answer if it can help! – Waldi Sep 10 '20 at 13:01
  • yes, because this error will come in different circumstances and I guess people may get the answer to their problems with your answer, and my specific problem - /00LOCK thingy. I never saw this anywhere on stack overflow? – GaB Sep 10 '20 at 13:03

2 Answers2

2

I also encountered this situation when a package installation went wrong.

This problem occured to others, and there's even a function against this in the pacman Package Management package :

Sometimes install.packages can "fail so badly that the lock directory is not removed: this inhibits any further installs to the library directory (or for –pkglock, of the package) until the lock directory is removed manually." p_unlock deletes the directory 00LOCK that is left behind.

You can also do it manually : stop all R / RStudio sessions, find the 00LOCK directory (which might disappear as you close RStudio), and delete it.

This post explains how to avoid the lock.

Waldi
  • 39,242
  • 6
  • 30
  • 78
1

p_unlock in the pacman package did not work for me. I solved it by clearing the output (in R Studio: Session -> Restart and Clear Output).