Can no longer load tidyverse after failed install


I accidentally ran the command to (re-)install the tidyverse package on my machine while showing students how install it on their machines, and now I get:

Error in library(tidyverse) : there is no package called ‘tidyverse’

I still have all the version of its subpackages that existed on my machine before the accidental install, but I now have to load them individually. How can return my machine to its previous working state?

David Romano

The error message suggests tidyverse is no longer installed in your package library. Can you try reinstalling it?


If you get any error message while doing this, please post the complete console output you get so we can troubleshoot.

I have, and this is the initial output:

> install.packages("tidyverse")
also installing the dependencies ‘cli’, ‘lifecycle’, ‘vctrs’, ‘rlang’, ‘ggplot2’, ‘pillar’

  There are binary versions available but the source versions are later:
          binary source needs_compilation
cli        3.1.1  3.6.0              TRUE
lifecycle  1.0.1  1.0.3             FALSE
vctrs      0.3.8  0.5.2              TRUE
rlang      1.0.1  1.0.6              TRUE
ggplot2    3.3.5  3.4.0             FALSE
pillar     1.7.0  1.8.1             FALSE
tidyverse  1.3.1  1.3.2             FALSE

Do you want to install from sources the packages which need compilation? (Yes/no/cancel) no

After that, I get output like the following for each of the packages ggplot2, pillar, and tidyverse as well:

* installing *source* package ‘lifecycle’ ...
** package ‘lifecycle’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace ‘rlang’ 1.0.1 is being loaded, but >= 1.0.6 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘lifecycle’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/lifecycle’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/lifecycle’
Warning in install.packages :
  installation of package ‘lifecycle’ had non-zero exit status

except that where this appears for lifecycle:

namespace ‘rlang’ 1.0.1 is being loaded, but >= 1.0.6 is required

similar output appears for the others:

namespace ‘vctrs’ 0.3.8 is being loaded, but >= 0.5.0 is required [for ggplot2]
namespace ‘rlang’ 1.0.1 is already loaded, but >= 1.0.2 is required [for pillar]
namespace ‘ggplot2’ 3.3.3 is being loaded, but >= 3.3.5 is required [for tiidyverse]

However, only the tidyverse package is inaccessible afterwards.

You are using a very old R version so there are no precompiled binaries available for some of the tidyverse dependencies, therfore, the installation process fails.

You can either try to compile from source by answering "yes" to the previous question or update your R version so you can get access to precompiled binaries.

If I try to compile from source, I get the same result, and what I would like is to return my system to the way it was before the accidental execution of install.packages("tidyverse")—is that not possible?

That is unlike, at the very least you should be getting a different error message.

It is, you just need to find out what tidyverse version was installed or at least what version has dependencies with binaries available for R 3.6 and then you can install it with something like this (but obviously specifying the package version).

install_version("tidyverse", version = "?", repos = "")

Or, install the binary from the file link

packageurl <- " .? .? .tar.gz"
install.packages(packageurl, repos=NULL, type="source")

As a side note, I don't think using such an old R version for teaching is a good idea since most likely your students are going to be using a much newer version and a lot of things can work differently.

Thanks, @andresrcs.

Since my machine is old, I generally try to avoid upgrading until my students do wind up with version that work differently than my own, but so far, this hasn't happened in a while, and I know that upgrading will break rendering for me this time.

This allowed me to install the immdiately previous version of the tidyverse package, so thanks again @andresrcs .

This topic was automatically closed 7 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.