Victor Galuppo
Victor Galuppo

Reputation: 227

namespace 'rlang' 0.4.5 is being loaded, but >= 0.4.10 is required

I'm trying to install the 'lifecycle' package but rlangs is required.

Upon typing install.packages('lifecyle') I get the error that I'm importing a rlangs package which is newer than required ('rlang' 0.4.5 is being loaded, but >= 0.4.10 is required).

  • installing source package 'lifecycle' ...
    ** package 'lifecycle' successfully unpacked and MD5 sums checked
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace 'rlang' 0.4.5 is being loaded, but >= 0.4.10 is required
    ERROR: lazy loading failed for package 'lifecycle'
  • removing 'C:/Users/user/R/library/lifecycle' In R CMD INSTALL
    Warning in install.packages : installation of package ‘lifecycle’ had non-zero exit status

I've already uninstalled rlangs and reinstalled it on its own, but it still not working.

Not sure if it helps, but I get the following message beforehand:

There are binary versions available but the source versions are later:
rlang - binary: 0.4.5 - source: 0.4.10 - needs_compilation: TRUE
lifecycle - binary: 0.2.0 - source: 1.0.0 - needs_compilation: FALSE

This error makes little sense and differs from others posts with this kind of error.

Upvotes: 15

Views: 82736

Answers (5)

Jean Castro
Jean Castro

Reputation: 331

You should try removing remove.packages("rlang") then install.packages("rlang")

Upvotes: 17

Edgar Manukyan
Edgar Manukyan

Reputation: 1301

RStudio needs rlang and maybe other package to do the R code diagnostics. Hence it loads it whenever the global option R diagnositics is checked. Try to uncheck it, restart the R session:

enter image description here

Upvotes: 1

Jammy
Jammy

Reputation: 23

I had the same problem, and when I tried to update the rlang package, it told me that rlang could not be unloaded as it was required by something else (I presume when you try to update, the package gets unloaded and then the latest version gets loaded). After coming to this question and reading some answers, I saw that I should move to the latest version in R Studio Cloud - Image with arrow indicating how to move to the latest version in R Studio Cloud

Upvotes: 0

J. Dowee
J. Dowee

Reputation: 379

Not sure why but it worked for me, close all files in rstudio editor and run in the console:

install.packages("https://cran.r-project.org/src/contrib/Archive/rlang/rlang_0.4.10.tar.gz", repos = NULL, type="source")

Upvotes: 1

eduardokapp
eduardokapp

Reputation: 1751

First of all: your version is not newer, it's older. 0.4.5 < 0.4.10.

The issue is that for whatever reason the binary version you have access to is of version 0.4.5, but the source version (which needs compiling) is of version 0.4.10.

I believe the simplest solution would be downloading the source package and installing it as source.

install.packages("https://cran.r-project.org/src/contrib/Archive/rlang/rlang_0.4.10.tar.gz", repos = NULL, type="source")

Now, if you don't want the trouble, I belive another possible solution would be updating your R version, which will in turn update the binary versions available for most packages.

Upvotes: 8

Related Questions