Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems installing r package via devtools install_github

Tags:

github

r

devtools

I am developing two packages on GitHub and I am trying to install them using the devtools::install_github() command.

Since the repositories are private, I created a auth_token for my account (as far as I see, there is no way to do this for a single repo?)

devtools::install_github("mariodejung/rMQanalysis", 
                         auth_token="6cd2dbe8bd1f062842b90afXXXXXXXXXXXXXXXXX", 
                         ref="develop", 
                         dependencies=TRUE)
devtools::install_github("mariodejung/cfpscripts", 
                         auth_token="6cd2dbe8bd1f062842b90afXXXXXXXXXXXXXXXXX", 
                         ref="develop")

The installation of the first package works as expected, the second one starts installing but stops with an error and for any reason it mentioned the first already installed package. See the error in the comment at the end. I don't know why this happens and how to resolve it.

I added the error message below again since I changed some things already.

Sorry for changing the auth_token but the script should stay private for now.

I checked also to install both packages with just one command but it leads to the same error message. I also added the GITHUB_PAT variable in my environment as suggested from the comments, to not use the auth token publicly.

devtools::install_github(c("mariodejung/rMQanalysis","mariodejung/cfpscripts"), 
                         ref="develop", 
                         dependencies=TRUE)

This command now installs the rMQanalysis package successfully and fails with the same error message while installing cfpscripts. Still no idea how to figure out what the problem is. It works on other machines. Also all dependencies are installed.

devtools::install_github(c("mariodejung/rMQanalysis","mariodejung/cfpscripts"), ref='develop', quiet=FALSE)
Using GitHub PAT from envvar GITHUB_PAT
Downloading GitHub repo mariodejung/rMQanalysis@develop
from URL https://api.github.com/repos/mariodejung/rMQanalysis/zipball/develop
Installing rMQanalysis
"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  "C:/Users/cfproteomics/AppData/Local/Temp/RtmpktvmUK/devtools43850da641a/mariodejung-rMQanalysis-0e38dd3463ea830b19f0afa2ade6f2e14db93041"  \
  --library="C:/Users/cfproteomics/Documents/R/win-library/3.2" --install-tests 

* installing *source* package 'rMQanalysis' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
** help
No man pages found in package  'rMQanalysis' 
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (rMQanalysis)
Downloading GitHub repo mariodejung/cfpscripts@develop
from URL https://api.github.com/repos/mariodejung/cfpscripts/zipball/develop
Installing cfpscripts
Downloading GitHub repo mariodejung/rMQanalysis@develop
from URL https://api.github.com/repos/mariodejung/rMQanalysis/zipball/develop
Error in stop(github_error(request)) : Not Found (404)

I also used the traceback() function but it doesn't give more insights...

15: stop(github_error(request))
14: download_github(dest, src, auth)
13: remote_download.github_remote(remote, quiet = quiet)
12: remote_download(remote, quiet = quiet)
11: FUN(X[[i]], ...)
10: vapply(remotes, install_remote, ..., FUN.VALUE = logical(1))
9: install_remotes(object$remote[behind], ..., quiet = quiet)
8: update.package_deps(pkg, ..., Ncpus = threads, quiet = quiet, 
       upgrade = upgrade)
7: update(pkg, ..., Ncpus = threads, quiet = quiet, upgrade = upgrade)
6: install_deps(pkg, dependencies = initial_deps, upgrade = upgrade_dependencies, 
       threads = threads, force_deps = force_deps, quiet = quiet, 
       ...)
5: install(source, ..., quiet = quiet, metadata = metadata)
4: FUN(X[[i]], ...)
3: vapply(remotes, install_remote, ..., FUN.VALUE = logical(1))
2: install_remotes(remotes, quiet = quiet, ...)
1: devtools::install_github(c("mariodejung/rMQanalysis", "mariodejung/cfpscripts"), 
       ref = "develop", quiet = FALSE)

UPDATE2

The whole problem seems to be a bug in devtools 1.12.0. It works fine in 1.11.1.
I figured out, that my rMQanalysis package is mentioned in cfpscripts as Imports:. If I remove this Imports: statement from the Description, the package installs fine.
I am still wondering, why I can not set dependencies=FALSE to prevent install_github installing the dependent packages.

I filled already a bug report on devtools but no reaction yet.

like image 257
drmariod Avatar asked Sep 23 '16 09:09

drmariod


People also ask

Why I Cannot install package in R?

Changing the configuration in R Studio to solve install packages issue. Go To Tools -> Global option -> Packages. Then uncheck the option “Use secure download method for HTTP”. For other RStudio issues refer to official Troubleshooting Guide here.

How do I install R packages from a zip file?

Go into R, click on Packages (at the top of the R console), then click on "Install package(s) from local zip files", then find the zip file with arm from wherever you just saved it. Do the same thing to install each of the other packages you want to install.


1 Answers

Have you tried downloading or cloning the repository[since you have paid] and installing from source?

install.packages("/Path/to/source", repos=NULL, type="source")
like image 153
Adventure-Ro Avatar answered Oct 16 '22 23:10

Adventure-Ro