att / rcloud

Collaborative data analysis and visualization
http://rcloud.social
MIT License
430 stars 142 forks source link

reticulate uses unsolicited interactive prompt to ask for miniconda installation in `rcloud.jupyter` initialization blocking RCloud startup #2702

Closed s-u closed 2 years ago

s-u commented 4 years ago

Recent versions of reticulate will try to force the user to install their copy of miniconda if only system Python (even if perfectly working) is installed. This is done via an interactive prompt that cannot be disabled. That prompt will block RCloud at startup when rcloud.jupyter language is initialized.

RStudio provides no way to skip that prompt so the only options are either:

  1. make sure rcloud.jupyter.python.path configuration directive is set in rcloud.conf (which results in call to use_python() which skips the prompt)
  2. copy/paste the reticulate code that sets the miniconda flag to "no"
s-u commented 4 years ago

This bit me again (and will bite anyone starting clean install with Jupyter) so we should at least add rcloud.jupyter.python.path to the sample config or in absence of rcloud.jupyter.python.path do a simple test for /usr/bin/python{|2|3} and call use_python() to avoid this issue.

gordonwoodhull commented 4 years ago

Yep. I happened to have devtools open and I could see it insistently nagging me every 5-10 seconds do I want to install miniconda. 😝

Either approach (or both) is good with me.

gordonwoodhull commented 3 years ago

Related: use_python needs required=TRUE, or it will pick perhaps the one with the latest numpy, a67d96501f4c

I don't want to get into which version of python is best (look for the one that has Jupyter installed? ugh), so I'm just defaulting rcloud.jupyter.python.path to /usr/bin/python3 in rcloud.conf.samp.

I think this is the most common case, and recommended these days.

s-u commented 3 years ago

@gordonwoodhull I'd love to if we could have something about this more formally - i.e. detect such loops - it hits me every time on a clean instance and since c0c4f33 only changes the template, it doesn't help all those configs out there. I know it's really an RStudio issue which is really hard to solve externally (since it's their internal miniconda detection that screws it up), but somehow a warning or catch of the loop would be nice ...

gordonwoodhull commented 3 years ago

Sure... I don't know how to do that, but cancelling a prompt loop in general would be better than just avoiding the anaconda issue.

gordonwoodhull commented 3 years ago

Saw this again in a shiny notebook even though we have use_python(..., required=T) and also rcloud.jupyter.python.path set to a valid path. Blecch, what obnoxious behavior.

s-u commented 2 years ago

It seems that latest versions of reticulate can be convinced that this is a really bad idea by setting RETICULATE_MINICONDA_ENABLED=0 env var. Any sane admin would set that in Rprofile.site (since this is a real problem for any managed infrastructure, i.e. anyone in the real world), but we could help and set it in rcloud.jupyer if not set.