Persistent Python environment for RStudio Cloud projects

Update: when I install Miniconda + packages locally into the project folder itself, RStudio Cloud preserves those files when I copy the project. Remaining problems:

  1. Trouble setting up tensorflow on RStudio Cloud.
  2. I need to set the WORKON_HOME env var to "virtualenvs" before doing anything in TensorFlow. My use case has several sub-projects, so I need multiple copies of the same .Renviron file.
install.packages("keras")
reticulate::install_miniconda("miniconda")
Sys.setenv(WORKON_HOME = "virtualenvs")
reticulate::virtualenv_create("r-reticulate", python = "miniconda/bin/python")
tensorflow::install_tensorflow(
  method = "virtualenv",
  conda = "miniconda/bin/conda",
  envname = "r-reticulate",
  restart_session = FALSE
)
keras::install_keras(
  method = "virtualenv",
  conda = "miniconda/bin/conda",
  envname = "r-reticulate"
)