Open gsofr opened 5 years ago
I also ran into this problem, and it takes forever because it re-downloads all sources the init time you init(), even if only one package failed. This happens to me for the "MASS" package, which seems to be due to a CRAN synchronization error - my Rstudio is installing a more recent version than packrat's CRAN check identifies (using a slightly out of date cran mirror presumably).
Hello,
I am trying to initialize packrat within a project and it starts creating the packrat folder but then in the end it pops up this error:
Error in snapshotSources(project, activeRepos(project), allRecordsFlat) : Errors occurred when fetching source files: Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) : Failed to retrieve package sources for bit64 0.9-7 from CRAN (internet connectivity issue?) [0.9-8 is current] Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) : Failed to retrieve package sources for dichromat 2.0-0 from CRAN (internet connectivity issue?) [2.0-1 is current] Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) : Failed to retrieve package sources for foreach 1.4.4 from CRAN (internet connectivity issue?) [1.5.1 is current] Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) : Failed to retrieve package sources for timeDate 3043.102 from CRAN (internet connectivity issue?) [3043.103 is current]
I then installed the development version of the package but still getting it.
Is there an easy solution to this or smth I am doing wrong?
traceback() 6: stop("Errors occurred when fetching source files:\n", errors) 5: snapshotSources(project, activeRepos(project), allRecordsFlat) 4: snapshotImpl(project, lib.loc = NULL, ignore.stale = TRUE, fallback.ok = TRUE, infer.dependencies = infer.dependencies) 3: initImpl(project, options, enter, restart, infer.dependencies) 2: withCallingHandlers(initImpl(project, options, enter, restart, infer.dependencies), error = function(e) { for (i in seq_along(priorStructure)) { file <- names(priorStructure)[[i]] fileExistedBefore <- priorStructure[[i]] fileExistsNow <- file.exists(file) if (!fileExistedBefore && fileExistsNow) { unlink(file, recursive = TRUE) } } }) 1: packrat::init()