Showing error repeatedly while loading "dplyr" package

I'm a beginner in using "R". To manipulate data when I'm trying to load "dplyr" package the following error message is showing:

Error: package or namespace load failed for ‘dplyr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘lifecycle’

Can anyone help me to get rid of this, please? Thanks in advance.

It's telling you that the package lifecycle is required, which you don't have installed:

install.packages("lifecycle")

Hi martin. Thanks for your reply. Yes, I installed the lifecycle package but still it's showing the same error. :frowning_face:

It can't be showing the same error if you installed it correctly.

Post the full error message.

It's same as befor

Error: package or namespace load failed for ‘dplyr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘lifecycle’

Have you restarted R after installing the packages?

yes. I've restarted.

Did your install of lifecycle give you any errors? It may have failed for its own reasons, that you should investigate.

Thanks for your comment. I've installed the lifecycle package and I guess there is no error in here. Here I'm posting the message that is shown after the installation of the lifecycle package.

Restarting R session...

install.packages("lifecycle")
Installing package into ‘C:/Users/USER/OneDrive/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependency ‘rlang’

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

Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/rlang_0.4.5.zip'
Content type 'application/zip' length 1115838 bytes (1.1 MB)
downloaded 1.1 MB

package ‘rlang’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\USER\AppData\Local\Temp\RtmpIRXTD9\downloaded_packages
installing the source package ‘lifecycle’

trying URL 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.0.tar.gz'
Content type 'application/x-gzip' length 83389 bytes (81 KB)
downloaded 81 KB

  • installing source package 'lifecycle' ...
    ** package 'lifecycle' successfully unpacked and MD5 sums checked
    ** R
    ** inst
    ** 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/OneDrive/Documents/R/win-library/3.5/lifecycle'
    In R CMD INSTALL
    Warning in install.packages :
    installation of package ‘lifecycle’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\USER\AppData\Local\Temp\RtmpIRXTD9\downloaded_packages’

Do you think it is okay or there are some problem in here? Will be happy to know your comment.

This says you should install a more recent version of rlang.

* 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'

Can you please suggest me how can I install the updated "rlang" package? I tried to install it writing install.package("rlang") but it's installing the same version (0.4.5)
I'm using the R version 3.5.3

I would recommend using renv as a package manager

Since you are using a very old R version you are forced to compile packages from source instead of installing precompiled binaries. For compiling packages in Windows systems you need to install a suitable version of RTools, you can download it from here:

Altough I recommend updating your R version and also setting your package library folder in a non synced folder (outside OneDrive in your case) since R has problems with that very often.

1 Like

Finally I get rid of the problem. I just installed the version 4.1.0 of R and now able to install dplyr package without any error. Thanks everyone for your responses.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.