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

Stuck at install.packages #341

Open
xiaodaigh opened this issue Oct 2, 2019 · 8 comments
Open

Stuck at install.packages #341

xiaodaigh opened this issue Oct 2, 2019 · 8 comments

Comments

@xiaodaigh
Copy link

When I try to do

R"""
install.packages("data.table")
"""

The julia REPL gets stuck at

--- Please select a CRAN mirror for use in this session ---

so I tried

R"""
install.packages("data.table", repos="https://cran.rstudio.com")
"""

and it also gets stuck, but this time no error message. How can I install packages through RCall.jl? I am call RCall in my package so I want to provide a function to my users to install packages.

@xiaodaigh xiaodaigh changed the title Stuck at Stuck at install.packages Oct 2, 2019
@Non-Contradiction
Copy link
Contributor

The problem is the same as rcall or R repl. I'm not sure where the problem is, but a temporary solution could be to install R packages through some external process by run.

@simonbyrne
Copy link
Member

I think if you set CRAN mirror beforehand, it should work.

We should provide a prompt mechanism as well though

@xiaodaigh
Copy link
Author

Maybe access this PR? It works for me #342

@angusmoore
Copy link

I think if you set CRAN mirror beforehand, it should work.

We should provide a prompt mechanism as well though

Unfortunately, I think this is a deeper issue. Any attempt to call utils::download.file hangs, so specifying a CRAN mirror doesn't help (which is what install.packages is doing under the hood). I've only tested on Windows 10, but can check on linux later today.

MWE:

R"""
utils::download.file("https://cran.r-project.org/bin/windows/contrib/3.6/ggplot2_3.2.1.zip","ggplot2.zip")
"""

This creates/touches the file, but doesn't download anything to it (i.e. the file exists on the filesystem, but is 0b).

@yha
Copy link

yha commented Jan 19, 2023

Why was this closed?
I see the same issue with version 0.13.14 as well as on master. install.packages is stuck at the "Please select a CRAN mirror" message. utils::download.file opens a progress bar and is then stuck.

@ViralBShah ViralBShah reopened this Jan 20, 2023
@palday
Copy link
Collaborator

palday commented Jul 17, 2024

Can you try adding method="wget" to your install.packages invocation? It's somewhat expected behavior that interactive menus on the R side don't work in a plain reval/ R"..." invocation, but they should work in the R REPL mode. R however can fail rather ungracefully when the default download mode isn't available (which I've often run into on CI).

@xiaodaigh
Copy link
Author

Tried it. Same issue

@palday
Copy link
Collaborator

palday commented Jul 17, 2024

Hmmm, I'm at a loss. We literally use this in our own CI:

tmp = mktempdir()
reval("""lib <- "$(tmp)"
.libPaths(lib)
install.packages("ape", repos="https://cloud.r-project.org", method="wget", lib=lib)
library("ape")""")

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

No branches or pull requests

7 participants