Error installing tidyverse as can't update readr

Hi, all, newbie here. I have been trying to install tidyverse and I keep hitting this snag:

Error in install.packages : cannot remove prior installation of package ‘readr’

After the first time I updated my R and RStudio.
The second time I tried to remove readr from the packages//system library window but this seems to fail.

This what I have so far:

Error in install.packages : cannot remove prior installation of package ‘readr’
> remove.packages("readr")
Removing package from ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library’
(as ‘lib’ is unspecified)
> install.packages("tidyverse")
also installing the dependencies ‘testthat’, ‘backports’, ‘lifecycle’, ‘isoband’, ‘vctrs’, ‘ellipsis’, ‘broom’, ‘dbplyr’, ‘dplyr’, ‘ggplot2’, ‘haven’, ‘hms’, ‘httr’, ‘modelr’, ‘pillar’, ‘purrr’, ‘readr’, ‘readxl’, ‘reprex’, ‘rlang’, ‘rvest’, ‘tibble’, ‘tidyr’, ‘xml2’


  There are binary versions available but the source versions
  are later:
           binary source needs_compilation
testthat    2.0.1  2.3.2              TRUE
backports   1.1.3  1.1.6              TRUE
isoband     0.1.0  0.2.1              TRUE
vctrs       0.1.0  0.2.4              TRUE
ellipsis    0.1.0  0.3.0              TRUE
broom       0.4.5  0.5.6             FALSE
dbplyr      1.3.0  1.4.3             FALSE
dplyr     0.8.0.1  0.8.5              TRUE
ggplot2     3.1.0  3.3.0             FALSE
haven       2.1.0  2.2.0              TRUE
hms         0.4.2  0.5.3             FALSE
httr        1.4.0  1.4.1             FALSE
modelr      0.1.4  0.1.7             FALSE
pillar      1.3.1  1.4.3             FALSE
purrr       0.3.2  0.3.4              TRUE
reprex      0.2.1  0.3.0             FALSE
rlang       0.3.1  0.4.6              TRUE
rvest       0.3.2  0.3.5             FALSE
tibble      2.1.1  3.0.1              TRUE
tidyr       0.8.3  1.0.2              TRUE
xml2        1.2.0  1.3.2              TRUE
tidyverse   1.2.1  1.3.0             FALSE

Do you want to install from sources the packages which need compilation?
y/n: y
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/readr_1.3.1.tgz'
Content type 'application/x-gzip' length 593181 bytes (579 KB)
==================================================
downloaded 579 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/readxl_1.3.1.tgz'
Content type 'application/x-gzip' length 1503032 bytes (1.4 MB)
==================================================
downloaded 1.4 MB

Error in install.packages : cannot remove prior installation of package ‘readr’
> remove.packages("readr")
Removing package from ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library’
(as ‘lib’ is unspecified)

What happens if you manually delete the readr package from your library by going to the file path?

Also, you should consider upgrading your version of R. The latest version, 4.0.0, came out pretty recently, or you can install 3.6.3, which has been out since February, if you prefer one that's been around for a bit longer. Note that you will have to reinstall all of your packages, as the upgrade to 3.5.* involved major changes.

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

Thanks for this, Mara.

Following your comment I realised that my attempt to update R had failed, or rather, I'd updated R Studio, but not R :-/