How-To: Rstudio: Launch Rstudio in Conda Environment From Command Line

Question

How do I launch Rstudio in a conda environment from the command line?

 

Answer

1. Open an anaconda prompt or terminal.

Note:  To open an Anaconda Prompt in Windows or the Terminal in MacOS, see "How-To: Using Anaconda -  Launch a Virtual Conda Environment via Command Line Interface

 

2. From the command line (CLI) in the base environment, activate the conda environment you wish to use.

anaconda prompt with "conda activate my_rstudio_env"

 

3. From the CLI in the activated environment, add the Rstudio executable to the path:

set path="C:\Program Files\RStudio";%path%

anaconda prompt with "set path="C:\Program Files\RStudio";%path%"

Note:  Enure Rstudio was installed from the company portal so the above path is correct, see "How-To: Install Rstudio From Company Portal"

 

4. From the CLI in the activated environment, enter "rstudo" to launch.

anaconda prompt with "rstudio"