r-lib / rlang

Low-level API for programming with R
https://rlang.r-lib.org
Other
500 stars 137 forks source link

Issues updating rlang in RStudio #1515

Closed seandres11 closed 1 year ago

seandres11 commented 1 year ago

Hello!

I have been having a hard time loading many packages that require rlang in R version 1.4.1

When I load packages which depend on rlang (such at dplyr), the console tells me the following error:

Error: package or namespace load failed for ‘dplyr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘rlang’ 1.0.5 is already loaded, but >= 1.0.6 is required

I have tried installing with 'dependencies=T' and restarting R, however the problem still persists.

Please let me know if you know of any work arounds for this.

Cheers, Sam

lionel- commented 1 year ago

What happens when you reinstall rlang?

Usually these problems occur on Windows because R can't replace DLLs of loaded packages on that OS. So whenever you update packages, you need to make sure:

Then, start R and update the desired packages in the very first command.

lionel- commented 1 year ago

Try updating with https://github.com/r-lib/pak

blueja5 commented 1 year ago

I am having the same problem going from 1.02 to 1.06. It seems that the binaries aren't available - is this right? I haven't used compilation tools and would ideally not start doing but not being able to update rlang is causing me a lot of problems with other packages? I am on a mac using 4.0.2

blueja5 commented 1 year ago

I have also tried pak: pak::pkg_install("rlang") ✓ Loading metadata database ... done

→ Will update 1 package. → The package (742.51 kB) is cached.

lionel- commented 1 year ago

I can see on the CRAN page that binaries have been built for all OSes: https://cran.r-project.org/web/packages/rlang/index.html

What repo are you using? Does your setup have any sort of restrictions?

blueja5 commented 1 year ago

I have figured it out (I think.). I was using R4.0.2. When I updated to 4.1.3 I was able to update rlang and then everything that depended on it. I am not sure if this should have been obvious to me (I am a basic user) but hopefully useful to someone else. I can't go up to 4.2 without changing OS on my rather old Mac so avoiding for now. it seems that the available binaries only work for more recent R - but the rlang manual says ok for R 3.4 and above (or similar) so I had expected it to be ok.