Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to install httr2 #708

Closed
annalena13 opened this issue Mar 24, 2025 · 6 comments
Closed

unable to install httr2 #708

annalena13 opened this issue Mar 24, 2025 · 6 comments

Comments

@annalena13
Copy link

Hi, I am unable to install httr2,
I keep getting this message:
Warnung in system("sh ./configure.win") 'sh' not found
ERROR: configuration failed for package 'httr2'

@hadley
Copy link
Member

hadley commented Mar 24, 2025

Can you please give me more details about how you are installing httr2 and what operating system you are using?

@Shunlexxi
Copy link

Shunlexxi commented Mar 27, 2025

Hello, @hadley!

I'm also experiencing this problem. I am on Windows (11), and here is the error I keep getting (It seems to be the same as @annalena13)

Loading required package: httr2
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/shunl/AppData/Local/R/win-library/4.4’
(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
httr2 1.1.1 1.1.2 FALSE

installing the source package ‘httr2’

trying URL 'https://cran.rstudio.com/src/contrib/httr2_1.1.2.tar.gz'
Content type 'application/x-gzip' length 261794 bytes (255 KB)
downloaded 255 KB

  • installing source package 'httr2' ...
    ** package 'httr2' successfully unpacked and MD5 sums checked
    ** using staged installation
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA1/R/R-441.1/bin/x64/Rcmd.exe" config CC' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA1/R/R-441.1/bin/x64/Rcmd.exe" config CFLAGS' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA1/R/R-441.1/bin/x64/Rcmd.exe" config CXX' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA1/R/R-441.1/bin/x64/Rcmd.exe" config CXXFLAGS' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA1/R/R-441.1/bin/x64/Rcmd.exe" config CPPFLAGS' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA1/R/R-441.1/bin/x64/Rcmd.exe" config LDFLAGS' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA1/R/R-441.1/bin/x64/Rcmd.exe" config FC' had status 1
    'sh' is not recognized as an internal or external command,
    operable program or batch file.
    Warning in system2(file.path(R.home("bin"), "Rcmd.exe"), c("config", x), :
    running command '"C:/PROGRA1/R/R-441.1/bin/x64/Rcmd.exe" config FCFLAGS' had status 1
    Error in (function (...) : 'names' and 'val' are of different lengths
  • removing 'C:/Users/shunl/AppData/Local/R/win-library/4.4/httr2'
    Warning in install.packages :
    installation of package ‘httr2’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\shunl\AppData\Local\Temp\RtmpUrFevQ\downloaded_packages’
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘httr2’

@hadley
Copy link
Member

hadley commented Mar 28, 2025

Yeah, looks like the problem is that you're trying to install the source version of httr2, but as the message says you don't have any of the tools needed to build it. I'd suggest using the binary, which you'll probably just get if you wait another day or two, or using pak to install it instead:

install.packages("pak")
pak::pak("httr2")

@hadley hadley closed this as completed Mar 28, 2025
@Shunlexxi
Copy link

Thank you for your response, @hadley.

I eventually got it (httr2) installed using VSCode.

But for the future and knowledge-sake, what do you mean by waiting one/two days? How does that connect with the problem- not having a tool to build? I tried installing the tool I download from CRAN link (gotten from the error message at the terminal) but it says "the program does not support the version of Windows your computer is running".

Thank you for your response, again!

@hadley
Copy link
Member

hadley commented Mar 28, 2025

CRAN usually builds the binaries for you, but if you try and install just after httr2 has been released the binaries might not have been built yet.

@Shunlexxi
Copy link

Thanks for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants