2 years ago

#52129

test-img

Zack

How to set default conda / python environment for R

I'm new to R and shiny.

I setup a server and it mostly works, but R code that references the boto3 library fails with

"ModuleNotFoundError: No module named 'boto3'"

However, if I add this code at the top of the file:

library(reticulate)

use_condaenv("/home/ubuntu/anaconda3/envs/python_3x_nix")

Then, it works.

Even more confusing - once it works, I can remove those two lines and it continues to work for a while. Then, I suppose some kind of context object gets flushed and the errors come back.

So it would seem that the issue is just getting R to run with the correct conda environment (which I setup through conda externally) by default.

Can anyone tell me whether this is possible, and if so, then how?

python

r

shiny

conda

reticulate

0 Answers

Your Answer

Accepted video resources