Failing to install Github package, "had non-zero exit status" error - r

I have been unsuccessful at installing the package 'HonestDiD' from Github. It says that the package in question 'had non-zero exit status.' I followed the instructions given here. Any idea how to solve this issue? Here is the code/full error message.
devtools::install_github("asheshrambachan/HonestDiD")
Downloading GitHub repo asheshrambachan/HonestDiD#HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
Enter one or more numbers, or an empty line to skip updates:3
√ checking for file 'C:\Users\louis\AppData\Local\Temp\RtmpkZzlr8\remotes43401e3a797\asheshrambachan-HonestDiD-1723b17/DESCRIPTION' ...
- preparing 'HonestDiD': (601ms)
√ checking DESCRIPTION meta-information
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- looking to see if a 'data/datalist' file should be added
- building 'HonestDiD_0.1.0.tar.gz'
Installing package into ‘C:/Users/louis/OneDrive/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'HonestDiD' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error: (converted from warning) package 'CVXR' was built under R version 3.6.3
Execution halted
ERROR: lazy loading failed for package 'HonestDiD'
* removing 'C:/Users/louis/OneDrive/Documents/R/win-library/3.6/HonestDiD'
Error: Failed to install 'HonestDiD' from GitHub:
(converted from warning) installation of package ‘C:/.../HonestDiD_0.1.0.tar.gz’ had non-zero exit status

Related

Snakemake installing R package in rule environment: error cannot move 00LOCK permission denied

I'm writing a Snakemake pipeline with a rule that will run an R script. This rule has its own environment that looks like this:
channels:
- conda-forge
- r
- bioconda
dependencies:
- r-base = 4.1.1
- r-ggplot2 = 3.3.5
- r-biocmanager = 1.30.16
Next to the above packages, I also need ggbio, which can be installed with biocmanager:
if(!require(ggbio, quietly=TRUE)){ # if the package is not there, install it
BiocManager::install("ggbio")
}
When executing this rule via Snakemake, initially everything goes right, and most dependencies of the ggbio package get installed. However, after some while, I get the following error:
...
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
mv: cannot move '/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/00LOCK-xml2/00new/xml2' to '/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/xml2': Permission denied
ERROR: moving to final location failed
ERROR: dependency ‘xml2’ is not available for package ‘biomaRt’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/biomaRt’
ERROR: dependency ‘biomaRt’ is not available for package ‘GenomicFeatures’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/GenomicFeatures’
ERROR: dependency ‘GenomicFeatures’ is not available for package ‘VariantAnnotation’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/VariantAnnotation’
ERROR: dependency ‘GenomicFeatures’ is not available for package ‘OrganismDbi’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/OrganismDbi’
ERROR: dependency ‘GenomicFeatures’ is not available for package ‘ensembldb’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/ensembldb’
ERROR: dependencies ‘GenomicFeatures’, ‘VariantAnnotation’, ‘ensembldb’ are not available for package ‘biovizBase’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/biovizBase’
ERROR: dependencies ‘biovizBase’, ‘VariantAnnotation’, ‘GenomicFeatures’, ‘OrganismDbi’, ‘ensembldb’ are not available for package ‘ggbio’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/ggbio’
The downloaded source packages are in
‘/tmp/RtmpiQdboR/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Old packages: 'fansi'
Warning messages:
1: In .inet_warning(msg) :
installation of package ‘xml2’ had non-zero exit status
2: In .inet_warning(msg) :
installation of package ‘biomaRt’ had non-zero exit status
3: In .inet_warning(msg) :
installation of package ‘GenomicFeatures’ had non-zero exit status
4: In .inet_warning(msg) :
installation of package ‘VariantAnnotation’ had non-zero exit status
5: In .inet_warning(msg) :
installation of package ‘OrganismDbi’ had non-zero exit status
6: In .inet_warning(msg) :
installation of package ‘ensembldb’ had non-zero exit status
7: In .inet_warning(msg) :
installation of package ‘biovizBase’ had non-zero exit status
8: In .inet_warning(msg) :
installation of package ‘ggbio’ had non-zero exit status
Error in library(ggbio) : there is no package called ‘ggbio’
Execution halted
The error seems to originate from this part:
mv: cannot move '/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/00LOCK-xml2/00new/xml2' to '/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/xml2': Permission denied
I get this error only when I run Snakemake from the Ubuntu app on my Windows. If I run it on the server, it works:
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (xml2)
... (and then it continues to the other packages)
The versions are the same on the server and local, which is 1.3.3 for xml2. I've seen other questions relating to this lock issue (here and here), and most of them suggest doing something like this:
install.packages("Rcpp", dependencies = TRUE, INSTALL_opts = '--no-lock')
But this doesn't work for me because the package doesn't get installed with install.packages(). Adding options("install.lock"=FALSE) before the install also doesn't work. Also, when I check the R library folder in the environment location, I do not see the 00LOCK directory.
Any tips? Or is this just a Windows thing that's not easily fixable? Running the installment code in Rstudio does work, but I need the package to get installed in the conda environment, not my standard Rstudio library.
The YAML shown is substandard (incorrect channel order). But more importantly, it generally does not work well to install anything other than Conda packages in Conda-managed R environments. Fortunately, all Bioconductor packages are on the bioconda channel (usually with a bioconductor- prefix and all lowercase), hence, everything should work perfectly fine with simply:
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- r-base=4.1.1
- r-ggplot2=3.3.5
- bioconductor-ggbio

GitHub installation on package 'MazamaScience/RAWSmet'

Here is the GitHub site for the package: https://github.com/MazamaScience/RAWSmet.
I used devtools::install_github('MazamaScience/RAWSmet') and got the error message:
> devtools::install_github('MazamaScience/RAWSmet')
Downloading GitHub repo MazamaScience/RAWSmet#HEAD
√ checking for file 'C:\Users\ygrund\AppData\Local\Temp\RtmpaUK4eB\remotes2c14665e277e\MazamaScience-RAWSmet-bced3ce/DESCRIPTION' ...
- preparing 'RAWSmet': (536ms)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts (352ms)
- checking for empty or unneeded directories
- building 'RAWSmet_0.2.4.tar.gz'
Installing package into ‘C:/Users/ygrund/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
* installing *source* package 'RAWSmet' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
Error: object 'US_stateCodeToName' is not exported by 'namespace:MazamaSpatialUtils'
Execution halted
ERROR: lazy loading failed for package 'RAWSmet'
* removing 'C:/Users/ygrund/Documents/R/win-library/4.0/RAWSmet'
* restoring previous 'C:/Users/ygrund/Documents/R/win-library/4.0/RAWSmet'
Error: Failed to install 'RAWSmet' from GitHub:
(converted from warning) installation of package ‘C:/Users/ygrund/AppData/Local/Temp/RtmpaUK4eB/file2c1440477e33/RAWSmet_0.2.4.tar.gz’ had non-zero exit status
I don't understand what is wrong here. Any help would be very appreciated.

R: unable to install gbm.auto package from Github

I'm trying to install the package gbm.auto via github, but the download does not seem to work. How can I solve this? I am working on a windows 10 Pro (R version 3.6.1, Rstudio version 1.2.5042). This is the error I get:
remotes::install_github("SimonDedman/gbm.auto")
Downloading GitHub repo SimonDedman/gbm.auto#master
√ checking for file 'C:\Users\Ststrubb\AppData\Local\Temp\RtmpOcwGGZ\remotes1d5c7c774f2a\SimonDedman-gbm.auto-96328bf/DESCRIPTION' ...
- preparing 'gbm.auto': (359ms)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- looking to see if a 'data/datalist' file should be added
- building 'gbm.auto_1.2.4.tar.gz'
Installing package into ‘C:/Users/Ststrubb/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'gbm.auto' ...
** using staged installation
** R
Error in parse(outFile) :
C:/Users/Ststrubb/AppData/Local/Temp/RtmpALsbRt/R.INSTALL7320575e5a03/gbm.auto/R/gbm.valuemap.R:462:0: unexpected end of input
460: beep(8)} # notify user & close function
461:
^
ERROR: unable to collate and parse R files for package 'gbm.auto'
* removing 'C:/Users/***/Documents/R/win-library/3.6/gbm.auto'
Error: Failed to install 'gbm.auto' from GitHub:
(converted from warning) installation of package ‘C:/Users/***/AppData/Local/Temp/RtmpOcwGGZ/file1d5c40b85311/gbm.auto_1.2.4.tar.gz’ had non-zero exit status
I get the same error when I used
githubinstall or remotes::install_github.

Download R Package via Github

I've been attempting to install the rethinking package for R. I've downloaded the prerequisites, including rstan, but am still getting the same error message. My code is as follows:
library(devtools)
install_github("rmcelreath/rethinking")
I keep getting this output:
Downloading GitHub repo rmcelreath/rethinking#master
Skipping 1 packages ahead of CRAN: StanHeaders
√ checking for file 'C:\Users\noahj\AppData\Local\Temp\RtmpK0JHwE\remotes2a60431d781f\rmcelreath-rethinking-f393f30/DESCRIPTION' ...
- preparing 'rethinking': (1.6s)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts (725ms)
- checking for empty or unneeded directories
- looking to see if a 'data/datalist' file should be added
- building 'rethinking_2.00.tar.gz' (699ms)
Installing package into ‘C:/Users/noahj/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'rethinking' ...
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error: (converted from warning) package 'rstan' was built under R version 3.6.3
Execution halted
ERROR: lazy loading failed for package 'rethinking'
* removing 'C:/Users/noahj/Documents/R/win-library/3.6/rethinking'
Error: Failed to install 'rethinking' from GitHub:
(converted from warning) installation of package ‘C:/Users/noahj/AppData/Local/Temp/RtmpK0JHwE/file2a605bda3304/rethinking_2.00.tar.gz’ had non-zero exit status
Thank you to anyone with any insights and help!

Package Installation From GitHub Error - Possibly File Path

I am currently trying to install some packages off of GitHub, but I keep on getting this fatal error. I think it has something to do with the file destination, but I am unsure. Any advice would be appreciated!
> devtools::install_github("hrbrmstr/albersusa")
Downloading GitHub repo hrbrmstr/albersusa#master
√ checking for file 'C:\Users\FirstName Surname\AppData\Local\Temp\RtmpeqCuBA\remotes51a46de62be1\hrbrmstr-albersusa-5b933bf/DESCRIPTION' (489ms)
- preparing 'albersusa':
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'albersusa_0.3.1.tar.gz'
Installing package into ‘C:/Users/FirstName Surname/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'albersusa' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Fatal error: cannot open file 'C:\Users\FirstName': No such file or directory
ERROR: lazy loading failed for package 'albersusa'
* removing 'C:/Users/FirstName Surname/Documents/R/win-library/3.6/albersusa'
Error in i.p(...) :
(converted from warning) installation of package ‘C:/Users/FirstName Surname/AppData/Local/Temp/RtmpeqCuBA/file51a45f6e3a8b/albersusa_0.3.1.tar.gz’ had non-zero exit status
The packages should be installed into ‘C:/Users/FirstName Surname/Documents/R/win-library/3.6’ as it says it is doing, however it gives the fatal error when it encounters: 'C:\Users\FirstName' which is different.
Edit: Windows 10, R-3.6.0, RStudio
Thanks!
Upgrading the r package to 4.0.1 version solved this issue

Resources