rpackagersvg

Problem in the installation of R package rsvg


I'm trying to install package without any success. Tried the following two methods:

1. install.packages("rsvg")

install.packages("rsvg")

Installing package into ‘C:/Users/hp/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is
  later:
     binary source needs_compilation
rsvg  2.3.1  2.3.2              TRUE

installing the source package ‘rsvg’

trying URL 'https://cloud.r-project.org/src/contrib/rsvg_2.3.2.tar.gz'
Content type 'application/x-gzip' length 183798 bytes (179 KB)
downloaded 179 KB

* installing *source* package 'rsvg' ...
** package 'rsvg' successfully unpacked and MD5 sums checked
** using staged installation
** libs
rm -f rsvg.dll rsvg.o
"C:/PROGRA~1/R/R-42~1.1/bin/x64/Rscript.exe" "../tools/winlibs.R" 2.48.8
Error in download.file(sprintf("https://github.com/rwinlib/rsvg/archive/v%s.zip",  : 
  download from 'https://github.com/rwinlib/rsvg/archive/v2.48.8.zip' failed
In addition: Warning message:
In download.file(sprintf("https://github.com/rwinlib/rsvg/archive/v%s.zip",  :
  URL 'https://codeload.github.com/rwinlib/rsvg/zip/refs/tags/v2.48.8': Timeout of 60 seconds was reached
Execution halted
make: *** [Makevars.win:7: winlibs] Error 1
ERROR: compilation failed for package 'rsvg'
* removing 'C:/Users/hp/AppData/Local/R/win-library/4.2/rsvg'

The downloaded source packages are in
        ‘C:\Users\hp\AppData\Local\Temp\RtmpmG8xM2\downloaded_packages’
Warning message:
In install.packages("rsvg") :
  installation of package ‘rsvg’ had non-zero exit status

2. remotes::install_github("ropensci/rsvg")

library(remotes)
install_github("ropensci/rsvg")
Downloading GitHub repo ropensci/rsvg@HEAD
  
✔  checking for file 'C:\Users\hp\AppData\Local\Temp\RtmpmG8xM2\remotes5a645f9057ed\ropensci-rsvg-6d9840f/DESCRIPTION'     
─  preparing 'rsvg':
   checking DESCRIPTION meta-information ...
   checking DESCRIPTION meta-information ... 
✔  checking DESCRIPTION meta-information
─  cleaning src     
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories     
─  building 'rsvg_2.3.2.tar.gz'
  
Warning:
  
   Warning: file 'rsvg/cleanup' did not have execute permissions: corrected
   Warning: file 'rsvg/configure' did not have execute permissions: corrected

  
   

Installing package into ‘C:/Users/hp/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
* installing *source* package 'rsvg' ...
** using staged installation
** libs
rm -f rsvg.dll rsvg.o
"C:/PROGRA~1/R/R-42~1.1/bin/x64/Rscript.exe" "../tools/winlibs.R" 2.48.8
Error in download.file(sprintf("https://github.com/rwinlib/rsvg/archive/v%s.zip",  : 
  download from 'https://github.com/rwinlib/rsvg/archive/v2.48.8.zip' failed
In addition: Warning messages:
1: In download.file(sprintf("https://github.com/rwinlib/rsvg/archive/v%s.zip",  :
  downloaded length 35551249 != reported length 43111940
2: In download.file(sprintf("https://github.com/rwinlib/rsvg/archive/v%s.zip",  :
  URL 'https://codeload.github.com/rwinlib/rsvg/zip/refs/tags/v2.48.8': Timeout of 60 seconds was reached
Execution halted
make: *** [Makevars.win:7: winlibs] Error 1
ERROR: compilation failed for package 'rsvg'
* removing 'C:/Users/hp/AppData/Local/R/win-library/4.2/rsvg'
Warning message:
In i.p(...) :
  installation of package ‘C:/Users/hp/AppData/Local/Temp/RtmpmG8xM2/file5a645596780/rsvg_2.3.2.tar.gz’ had non-zero exit status

sessionInfo()

sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] remotes_2.4.2

loaded via a namespace (and not attached):
 [1] processx_3.8.0    compiler_4.2.1    R6_2.5.1          rprojroot_2.0.3   cli_3.4.1         prettyunits_1.1.1 tools_4.2.1       withr_2.5.0      
 [9] curl_4.3.3        crayon_1.5.2      callr_3.7.2       ps_1.7.2          pkgbuild_1.3.1   

Solution

  • According to this issue, you should first install pkgconfig like this:

    install.packages('pkgconfig')
    install.packages('rsvg')
    library(rsvg)
    #> Linking to librsvg 2.48.4
    

    Created on 2022-10-28 with reprex v2.0.2