inbo / n2khab

R package with preprocessing functions and standard reference data for Flemish Natura 2000 (N2K) habitat (HAB) analyses
https://inbo.github.io/n2khab
GNU General Public License v3.0
2 stars 1 forks source link

Installation error (on some machines) #59

Closed florisvdh closed 4 years ago

florisvdh commented 4 years ago

With one user, the following happened:

> remotes::install_github("inbo/n2khab", build_vignettes = TRUE)
Downloading GitHub repo inbo/n2khab@master
Installing 2 packages: gdalUtils, R.methodsS3
Installing packages into ‘C:/R/library’
(as ‘lib’ is unspecified)

  There are binary versions available but the source versions are later:
            binary  source needs_compilation
gdalUtils    2.0.3 2.0.3.2             FALSE
R.methodsS3  1.7.1   1.8.0             FALSE

installing the source packages ‘gdalUtils’, ‘R.methodsS3’

trying URL 'https://cloud.r-project.org/src/contrib/gdalUtils_2.0.3.2.tar.gz'
Content type 'application/x-gzip' length 1062906 bytes (1.0 MB)
downloaded 1.0 MB

trying URL 'https://cloud.r-project.org/src/contrib/R.methodsS3_1.8.0.tar.gz'
Content type 'application/x-gzip' length 23615 bytes (23 KB)
downloaded 23 KB

* installing *source* package 'gdalUtils' ...
** package 'gdalUtils' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
  there is no package called 'R.methodsS3'
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package 'gdalUtils'
* removing 'C:/R/library/gdalUtils'
Error in i.p(...) :
  (converted from warning) installation of package ‘gdalUtils’ had non-zero exit status

This can be remedied by a manual installation of R.methodsS3 beforehand.

However is there some more direct way to prevent this from happening?

florisvdh commented 4 years ago

Closing this issue because it is now probably circumvented:

  1. gdalUtils is not longer a dependency (#61). The above issue has been delegated to gearslaboratory/gdalUtils#26.
  2. Since some time, a safer installation method is recommended on the homepage, which sets an environment variable to make remotes::install_github() more friendly (#68).
  3. At least two colleagues had success using this installation method in Windows (see e.g. here)