Unable to install STARS from GitHub -- non-zero exit status

Hi,
I am trying to install package stars direclty from github (using remotes::install_github("r-spatial/stars")), because one command is not working as it should be if I use stars normally installed using RStudio.

Unfortunatelly I am not able to do it. The error message:

> remotes::install_github("r-spatial/stars")
Downloading GitHub repo r-spatial/stars@master
Installing 1 packages: sf

  There is a binary version available but the source version is later:
   binary source needs_compilation
sf  0.8-1  0.9-0              TRUE

  Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/sf_0.8-1.zip'
Content type 'application/zip' length 39626867 bytes (37.8 MB)
downloaded 37.8 MB

package ‘sf’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Katrička\AppData\Local\Temp\RtmpmChuKV\downloaded_packages
√  checking for file 'C:\Users\Katrička\AppData\Local\Temp\RtmpmChuKV\remotes1930272ff1\r-spatial-stars-e26ceb8/DESCRIPTION' (1.2s)
-  preparing 'stars': (1.9s)
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts (476ms)
-  checking for empty or unneeded directories
-  building 'stars_0.4-1.tar.gz'
   
* installing *source* package 'stars' ...
** using staged installation
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
Error: package 'sf' 0.8.1 was found, but >= 0.9.0 is required by 'stars'
Execution halted
ERROR: lazy loading failed for package 'stars'
* removing 'C:/Program Files/R/R-3.6.3/library/stars'
Warning message:
In i.p(...) :
  installation of package ‘C:/Users/KATRIK~1/AppData/Local/Temp/RtmpmChuKV/file19307918447d/stars_0.4-1.tar.gz’ had non-zero exit status

I think problem is with package stars. Version 0.9.0 is required by 'stars', but it is not able to install it.
Can someone help me with this issue?

Thank you !

You are been asked to update sf package

install.packages("sf")

Thank you for your response @andresrcs

if I try to update it to newer version I get this error message:

install.packages("sf")
There is a binary version available but the source version is later:
   binary source needs_compilation
sf  0.8-1  0.9-0              TRUE

installing the source package ‘sf’

trying URL 'https://cran.rstudio.com/src/contrib/sf_0.9-0.tar.gz'
Content type 'application/x-gzip' length 8474738 bytes (8.1 MB)
downloaded 8.1 MB

* installing *source* package 'sf' ...
** package 'sf' successfully unpacked and MD5 sums checked
** using staged installation

   **********************************************
   WARNING: this package has a configure script
         It probably needs manual configuration
   **********************************************


** libs

*** arch - i386
rm -f sf.dll RcppExports.o bbox.o gdal.o gdal_geom.o gdal_read.o gdal_utils.o gdal_write.o geos.o hex.o ops.o polygonize.o proj.o proj_info.o raster2sf.o sfg.o signed_area.o stars.o wkb.o zm_range.o
mkdir -p ../inst
"C:/PROGRA~1/R/R-36~1.3/bin/i386/Rscript.exe" --vanilla "../tools/winlibs.R" 2.2.3
cp -r ../windows/gdal2-2.2.3/share/gdal ../inst/
cp -r ../windows/gdal2-2.2.3/share/proj ../inst/
C:/Program Files/R/Rtools/mingw_32/bin/g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.3/include" -DNDEBUG -I../windows/gdal2-2.2.3/include/gdal -I../windows/gdal2-2.2.3/include/geos -I../windows/gdal2-2.2.3/include/proj -I"C:/Program Files/R/R-3.6.3/library/Rcpp/include"        -O2 -Wall  -mtune=core2 -c RcppExports.cpp -o RcppExports.o
sh: C:/Program: No such file or directory
make: *** [C:/PROGRA~1/R/R-36~1.3/etc/i386/Makeconf:215: RcppExports.o] Error 127
ERROR: compilation failed for package 'sf'
* removing 'C:/Program Files/R/R-3.6.3/library/sf'
* restoring previous 'C:/Program Files/R/R-3.6.3/library/sf'
Warning in install.packages :
  installation of package ‘sf’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\Katricka\AppData\Local\Temp\RtmpGkFSxU\downloaded_packages’

Try installing Rtools on the root folder of the C drive, the system commands have issues with the empty space in "Program Files" folder.

1 Like

Thanks @andresrcs That worked !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.