I have a Quarto project with 2 .qmd files, each of them located in a folder with an _environment.local file. Like this:
- Notebook_01/
- Notebook_01.qmd
- environment.local
- Notebook_02/
- Notebook_02.qmd
- environment.local
The _environment.local file in each of the folders has only one line, that indicates the python to be used by reticulate. Each of then points to a different conda environment:
RETICULATE_PYTHON="/Users/user/miniconda3/envs/BionfTools/bin/python" (In folder Notebook_01) RETICULATE_PYTHON="/Users/user/miniconda3/envs/PPanGGOLiN/bin/python" (In folder Notebook_02)
This is because in Notebook_01 I want to use tools installed in the BionfTools conda environment and in Notebook_02 I want to use tools installed in the PPanGGOLiN conda environment.
If I do quarto render
RETICULATE_PYTHON gets set for the first rendered file and the same python is used for the second file. The same if I render individual files, whatever I use first for that session gets used all the time.
The only thing that worked for me is doing this on the terminal:
cd Notebook_01
RETICULATE_PYTHON="/Users/isabelfe/miniconda3/envs/BionfTools/bin/python"
quarto render
cd ..
cd Notebook_02
RETICULATE_PYTHON="/Users/isabelfe/miniconda3/envs/PPanGGOLiN/bin/python"
quarto render
cd ..
Is there any way to incorporate something like this in the _quarto.yml to indicate a RETICULATE_PYTHON for each .qmd file? Or for each folder if you locate them in different folders?
This will solve the issue of rendering. But, ideally I will like to be able to just run individual chunks of {bash} code while I am developing on R studio so I can alternate between conda environments easily. I tried using use_miniconda()
without luck. Also installing environments in each of the folders directly.
Is summary, is there a way to work in R Studio that allows you to move in between conda environments?
Thanks