r-lib / httr2

Make HTTP requests and process their responses. A modern reimagining of httr.
https://httr2.r-lib.org
Other
238 stars 59 forks source link

Package install fails with non-zero exit status #548

Closed anishjoni closed 1 month ago

anishjoni commented 1 month ago

Hello,

I have tried installing httr2 package through install.packages, using remotes::install_github() and also chaning CRAN repos but still the installation fails.

Here's a reprex of the error:

sessionInfo()
#> R version 4.4.1 (2024-06-14 ucrt)
#> Platform: x86_64-w64-mingw32/x64
#> Running under: Windows 11 x64 (build 22631)
#> 
#> Matrix products: default
#> 
#> 
#> locale:
#> [1] LC_COLLATE=English_Canada.utf8  LC_CTYPE=English_Canada.utf8   
#> [3] LC_MONETARY=English_Canada.utf8 LC_NUMERIC=C                   
#> [5] LC_TIME=English_Canada.utf8    
#> 
#> time zone: America/Toronto
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] digest_0.6.37     fastmap_1.2.0     xfun_0.47         glue_1.7.0       
#>  [5] knitr_1.48        htmltools_0.5.8.1 rmarkdown_2.28    lifecycle_1.0.4  
#>  [9] cli_3.6.3         reprex_2.1.1      withr_3.0.1       compiler_4.4.1   
#> [13] rstudioapi_0.16.0 tools_4.4.1       evaluate_0.24.0   yaml_2.3.10      
#> [17] rlang_1.1.4       fs_1.6.4
install.packages('httr2')
#> Installing package into 'D:/GitHub/Learn by doing/Tidy Tuesday/renv/library/R-4.4/x86_64-w64-mingw32'
#> (as 'lib' is unspecified)
#> 
#>   There is a binary version available but the source version is later:
#>       binary source needs_compilation
#> httr2  1.0.3  1.0.4             FALSE
#> installing the source package 'httr2'
#> Warning in install.packages("httr2"): installation of package 'httr2' had
#> non-zero exit status

Created on 2024-09-14 with reprex v2.1.1

Mr-KAM commented 1 month ago

I have the same problem

hadley commented 1 month ago

Can you please try installing the pak package, and then using that to install httr2: pak::pak("httr2"). It will either work or at least give a more informative error.

nebuscar commented 1 month ago

Can you please try installing the pak package, and then using that to install httr2: pak::pak("httr2"). It will either work or at least give a more informative error.

Thx! I got it! It indicated that I was missing the appropriate Rtools. It shows the following message:

Error:        
! error in pak subprocess
Caused by error: 
! Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.
Type .Last.error to see the more details.

I used the following command pkgbuild::check_build_tools(debug = TRUE)to perform a self-check and installation. After installing Rtools, I was able to successfully install httr2.

donaldmusgrove commented 1 month ago

This seems to be a straightforward error, the Windows binary of the latest version, 1.0.4, is not yet available. What's odd is that it has now been 5 days since version 1.0.4 landed on CRAN and the Windows binary of version 1.0.4 is still not available.

Looks like there is an error on CRAN with old release and macos https://cran.r-project.org/web/checks/check_results_httr2.html. Can that be causing the unavailability of the Windows binary?

Info above is current as of the time of my posting.

anishjoni commented 1 month ago

Can you please try installing the pak package, and then using that to install httr2: pak::pak("httr2"). It will either work or at least give a more informative error.

Sorry, my error got resolved before I could try installing it via pak package.

This worked for me: install.packages("httr2", type="binary")

hadley commented 1 month ago

Looks like the binary build was just a bit slower than usual. It's there now.