R 4, tidyverse install issue, no httr package - r

I did a fresh install of R and RStudio today, and now tidy verse will not load, including when I specify (or don't specify) the lib for the install and the load. Have restarted multiple times, each time the issue is that "there is no package called 'httr'". Code example:
install.packages("tidyverse", dependencies = TRUE, lib = "/Users/Darcy/Library/R/4.0/library")
library(tidyverse, lib = "/Users/Darcy/Library/R/4.0/library")
and resulting failure (complete):
> install.packages("tidyverse", dependencies = TRUE, lib = "/Users/Darcy/Library/R/4.0/library")
also installing the dependency ‘httr’
There is a binary version available but the source version is later:
binary source needs_compilation
httr 1.4.1 1.4.2 FALSE
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/tidyverse_1.3.0.tgz'
Content type 'application/x-gzip' length 433049 bytes (422 KB)
==================================================
downloaded 422 KB
The downloaded binary packages are in
/var/folders/rl/vd2lvhf96fd9d69qvmc9pys00000gq/T//Rtmpj5S5Yc/downloaded_packages
installing the source package ‘httr’
trying URL 'https://cran.rstudio.com/src/contrib/httr_1.4.2.tar.gz'
Content type 'application/x-gzip' length 159950 bytes (156 KB)
==================================================
downloaded 156 KB
dyld: lazy symbol binding failed: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib
/Library/Frameworks/R.framework/Resources/bin/INSTALL: line 34: 1057 Done echo 'tools:::.install_packages()'
1058 Abort trap: 6 | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --no-echo --args ${args}
Warning in install.packages :
installation of package ‘httr’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/rl/vd2lvhf96fd9d69qvmc9pys00000gq/T/Rtmpj5S5Yc/downloaded_packages’
> library(tidyverse, lib = "/Users/Darcy/Library/R/4.0/library")
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘httr’

My iMac computer cannot update any more, but switching to R3.6.3 (El Capitan) was an effective solution.
I mistakenly updated my R from 3.4.2 to 4.0.2, which was too far.

Related

Error with C Stack Usage when installing packages

I haven't touched R in a while, and just tried running some old Bioconductor code on my new Mac (M1, 2020, running OS Monterey 12.2.1).
I am able to run the beginning of my script (where I install packages) seemingly without issue:
library("knitr")
.cran_packages <- c("ggplot2", "gridExtra")
.bioc_packages <- c("dada2", "phyloseq", "DECIPHER", "phangorn", "msa")
.inst <- .cran_packages %in% installed.packages()
if(any(!.inst)) {
install.packages(.cran_packages[!.inst])
}
.inst <- .bioc_packages %in% installed.packages()
if(any(!.inst)) {
BiocManager::install(.bioc_packages[!.inst])
}
However, when I go to actually load the packages, like so:
sapply(c(.cran_packages, .bioc_packages), require, character.only = TRUE)
many of the bioconductor packages fail to load, with this readout:
Loading required package: dada2
Error: package or namespace load failed for ‘dada2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘GenomeInfoDbData’
Loading required package: phyloseq
Error: package or namespace load failed for ‘phyloseq’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘GenomeInfoDbData’
Loading required package: DECIPHER
Loading required package: Biostrings
Failed with error: ‘package ‘S4Vectors’ required by ‘Biostrings’ could not be found’
In addition: Warning message:
In read.dcf(file.path(p, "DESCRIPTION"), c("Package", "Version")) :
cannot open compressed file '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/S4Vectors/DESCRIPTION', probable reason 'No such file or directory'
Loading required package: msa
Loading required package: Biostrings
Failed with error: ‘package ‘S4Vectors’ required by ‘Biostrings’ could not be found’
In addition: Warning message:
In read.dcf(file.path(p, "DESCRIPTION"), c("Package", "Version")) :
cannot open compressed file '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/S4Vectors/DESCRIPTION', probable reason 'No such file or directory'
ggplot2 gridExtra dada2 phyloseq DECIPHER phangorn msa
TRUE TRUE FALSE FALSE FALSE TRUE FALSE
Based on this result, I have tried re-installing ‘GenomeInfoDbData’ and ‘S4Vectors’ separately. It looks like the issue with installing ‘GenomeInfoDbData’ is the version of ‘S4Vectors’. When I choose to skip updating S4Vectors, I get this error message:
> BiocManager::install("GenomeInfoDbData")
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for
details
replacement repositories:
CRAN: https://cran.rstudio.com/
Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.3 (2022-03-10)
Installing package(s) 'GenomeInfoDbData'
installing the source package ‘GenomeInfoDbData’
trying URL 'https://bioconductor.org/packages/3.14/data/annotation/src/contrib/GenomeInfoDbData_1.2.7.tar.gz'
Content type 'application/x-gzip' length 11193674 bytes (10.7 MB)
==================================================
downloaded 10.7 MB
Error: C stack usage 7953728 is too close to the limit
Execution halted
The downloaded source packages are in
‘/private/var/folders/84/4fxygqsd07zcn8kzy9yh8t2c0000gn/T/RtmppKV5Cc/downloaded_packages’
Old packages: 'S4Vectors'
Update all/some/none? [a/s/n]:
n
Warning message:
In .inet_warning(msg) :
installation of package ‘GenomeInfoDbData’ had non-zero exit status
and when I choose to proceed with updating S4Vectors (from binary), I get a similar error:
Old packages: 'S4Vectors'
Update all/some/none? [a/s/n]:
a
There is a binary version available but the source version is later:
binary source needs_compilation
S4Vectors 0.32.3 0.32.4 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) n
trying URL 'https://bioconductor.org/packages/3.14/bioc/bin/macosx/contrib/4.1/S4Vectors_0.32.3.tgz'
Content type 'application/x-gzip' length 2099211 bytes (2.0 MB)
==================================================
downloaded 2.0 MB
The downloaded binary packages are in
/var/folders/84/4fxygqsd07zcn8kzy9yh8t2c0000gn/T//RtmppKV5Cc/downloaded_packages
Warning message:
In .inet_warning(msg) :
installation of package ‘GenomeInfoDbData’ had non-zero exit status
This also, for some reason seems to involve an issue with my C-stack usage, which I cannot get to the bottom of. I have tried un-installing and re-installing R and R studio, trying both the version for the M1 macs and the Intel macs. Here's my system info at the moment:
R version 4.1.3 (2022-03-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.2.1

R: Installation of several packages had non-zero exit status

I've just started to encounter the "had non-zero exit status" error when trying to install a package. This holds true for readr (below) and ggplot2.
Weirdly enough, the packages have previously (previous R session 5 minutes earlier) been loaded and used, but when loading them now, it generally results in the following error:
> library(readr)
Error: package or namespace load failed for ‘readr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘pillar’
When trying to install the package again, it results in the following error;:
> install.packages('readr')
Error in install.packages : Updating loaded packages
Restarting R session...
> install.packages("readr")
also installing the dependencies ‘rlang’, ‘vroom’, ‘lifecycle’, ‘tzdb’
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.4.5 0.4.11 TRUE
vroom 1.2.0 1.5.4 TRUE
lifecycle 0.2.0 1.0.0 FALSE
readr 1.3.1 2.0.1 TRUE
Do you want to install from sources the packages which need compilation? (Yes/no/cancel) No
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘tzdb’
Do you want to attempt to install these from sources? (Yes/no/cancel) No
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/rlang_0.4.5.tgz'
Content type 'application/x-gzip' length 1171073 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/vroom_1.2.0.tgz'
Content type 'application/x-gzip' length 2384663 bytes (2.3 MB)
==================================================
downloaded 2.3 MB
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/readr_1.3.1.tgz'
Content type 'application/x-gzip' length 777189 bytes (758 KB)
==================================================
downloaded 758 KB
The downloaded binary packages are in
/var/folders/kp/nyzw767n0qx2wpfwgplzg1bh0000gp/T//Rtmpu5HwNO/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 ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/lifecycle’
Warning in install.packages :
installation of package ‘lifecycle’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/kp/nyzw767n0qx2wpfwgplzg1bh0000gp/T/Rtmpu5HwNO/downloaded_packages’
I've tried other suggestions in this forum, but none seemed to work for me (a. o. this or this).
I am using MacOS Big Sur and RStudio.

Issues installing packages in R: "dyld: lazy symbol binding failed"

I'm trying to install tidyverse and tidycensus, among other packages, and I'm getting a similar error for all of them. I'm working on a Mac. I've tried installing the dependencies separately, but I get similar error. I've tried installing RTools, but that didn't change anything. I wish I could give more information, but I've never encountered an error like this.
Here's the code:
install.packages("tidyverse")
And here's the output:
also installing the dependency ‘broom’
There is a binary version available but the source version is later:
binary source needs_compilation
broom 0.5.6 0.7.0 FALSE
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/tidyverse_1.3.0.tgz'
Content type 'application/x-gzip' length 432989 bytes (422 KB)
==================================================
downloaded 422 KB
The downloaded binary packages are in
/var/folders/6k/0tw5jym93c762cchf9bym93w0000gn/T//RtmpNdVhZw/downloaded_packages
installing the source package ‘broom’
trying URL 'https://cran.rstudio.com/src/contrib/broom_0.7.0.tar.gz'
Content type 'application/x-gzip' length 604195 bytes (590 KB)
==================================================
downloaded 590 KB
dyld: lazy symbol binding failed: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib
/Library/Frameworks/R.framework/Resources/bin/INSTALL: line 34: 20265 Done echo 'tools:::.install_packages()'
20266 Abort trap: 6 | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --no-echo --args ${args}
Warning in install.packages :
installation of package ‘broom’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/6k/0tw5jym93c762cchf9bym93w0000gn/T/RtmpNdVhZw/downloaded_packages’

Cannot install devtools package on mac

I would like to use the ggbiplot function in R. I tried to install the devtools package first, but it doesn´t work.
I am using R studio Version 1.2.1335 and have a mac with version 10.14.5
Tried different types of code
install.packages("devtools")
library(devtools)
install_github("vqv/ggbiplot")
library(ggbiplot)
or
library(devtools)
install_github("ggbiplot", "vqv")
and i tried to answer this questiion Do you want to install from sources the packages which need compilation?
y/n: with y and n
install.packages("devtools")
also installing the dependencies ‘fs’, ‘usethis’, ‘testthat’
There are binary versions available but the source versions are later:
binary source needs_compilation
fs 1.2.7 1.3.1 TRUE
usethis 1.4.0 1.5.1 FALSE
testthat 2.0.1 2.2.1 TRUE
devtools 1.13.6 2.1.0 FALSE
Do you want to install from sources the packages which need compilation?
y/n: n
versuche URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/fs_1.2.7.tgz'
Content type 'application/x-gzip' length 746131 bytes (728 KB)
downloaded 728 KB
versuche URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/testthat_2.0.1.tgz'
Content type 'application/x-gzip' length 1660043 bytes (1.6 MB)
downloaded 1.6 MB
The downloaded binary packages are in
/var/folders/c0/sg0bg4dx2vz4qw6zdqgc4fpr0000gn/T//RtmpaTVVAF/downloaded_packages
installing the source packages ‘usethis’, ‘devtools’
versuche URL 'https://cran.rstudio.com/src/contrib/usethis_1.5.1.tar.gz'
Content type 'application/x-gzip' length 620225 bytes (605 KB)
downloaded 605 KB
versuche URL 'https://cran.rstudio.com/src/contrib/devtools_2.1.0.tar.gz'
Content type 'application/x-gzip' length 378899 bytes (370 KB)
downloaded 370 KB
installing source package ‘usethis’ ...
** Paket ‘usethis’ erfolgreich entpackt und MD5 Summen überprüft
** R
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘fs’ 1.2.7 is being loaded, but >= 1.3.0 is required
ERROR: lazy loading failed for package ‘usethis’
removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/usethis’
Warning in install.packages :
installation of package ‘usethis’ had non-zero exit status
ERROR: dependency ‘usethis’ is not available for package ‘devtools’
removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/c0/sg0bg4dx2vz4qw6zdqgc4fpr0000gn/T/RtmpaTVVAF/downloaded_packages’
library(devtools)
there is no package called ‘devtools’
I had the same issue (macOS Catalina 10.15.3, R version 3.6.2) and solved it by first installing 'openssl#1.1'
If you have homebrew you can install this via the command line
'brew install openssl#1.1'
(you also need Xcode and command line tools installed!)

Cannot install tidyverse package in R. Error there is no package called

I am attempting to install the package tidy verse in R studio and receiving these errors.
> install.packages('tidyverse')
also installing the dependency ‘rstudioapi’
There is a binary version available but the source version is later:
binary source needs_compilation
rstudioapi 0.9.0 0.10 FALSE
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/tidyverse_1.2.1.tgz'
Content type 'application/x-gzip' length 88754 bytes (86 KB)
==================================================
downloaded 86 KB
The downloaded binary packages are in
/var/folders/kn/b21xc36111z157czpz0swc900000gn/T//RtmpeVGvVh/downloaded_packages
installing the source package ‘rstudioapi’
trying URL 'https://cran.rstudio.com/src/contrib/rstudioapi_0.10.tar.gz'
Content type 'application/x-gzip' length 61888 bytes (60 KB)
==================================================
downloaded 60 KB
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘assertthat’
Calls: time.to ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
Warning in install.packages :
installation of package ‘rstudioapi’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/kn/b21xc36111z157czpz0swc900000gn/T/RtmpeVGvVh/downloaded_packages’
In addition I've attempted to install in base R and receive the same message. I've gone to the temporary folders and unzipped the package and moved that over to the library folder. When I attempt library(assertthat) it gives me an error that there is not a valid package installed.
I've successfully installed tidyverse before on this machine, but when trying to use it this time it told me it was not installed, so I've attempted to reïnstall it.
I deleted my .Rhistory, .Rdata, and .Rprofile files, restarted R and was able to install tidyverse with no issues.
I restarted my computer and installed devtools using install.packages("devtools").
After that I made sure to put Rtools on the PATH, simply following the instructions here: Using Rtools40 on Windows
Afterwards, I was able to install tidyverse using install.packages("tidyverse").

Resources