title: RStudio and python virtual environment - Python specified does not exist
body: <p>I'm aiming to run python from RStudio. My setup is Windows RStudio Version 1.2.1335 and conda 4.7.12 from GitBash.</p>
  
  <p>The RStudio support document (<a href="https://support.rstudio.com/hc/en-us/articles/360022909454-Best-Practices-for-Using-Python-with-RStudio-Connect" rel="nofollow noreferrer">https://support.rstudio.com/hc/en-us/articles/360022909454-Best-Practices-for-Using-Python-with-RStudio-Connect</a>) suggests creating a virtual environment in EVERY project. </p>
  
  <p>Create virtual environment.</p>
  
  <pre><code>bash$ virtualenv .venv --python=python3.6
  </code></pre>
  
  <p>This creates a .venv directory in . </p>
  
  <p>But then how to activate .venv? Running:</p>
  
  <pre><code>bash$ source activate .venv
  </code></pre>
  
  <p>Can't find .venv.</p>
  
  <p>Running:</p>
  
  <pre><code>bash$ conda activate ./.venv
  bash: [: too many arguments
  bash: [: too many arguments
  bash: [: too many arguments
  bash: [: too many arguments
  bash: [: too many arguments
  bash: [: too many arguments
  (c:\&lt;project-dir&gt;\.venv)
  </code></pre>
  
  <p>So the conda virtual env is running - not sure about the 'too many arguments' messages. </p>
  
  <p>Then to RStudio.</p>
  
  <p>Setting the in .Rprofile to ".venv/python". The .venv directory doesn't contain .venv/bin/python, instead the python.exe is at .venv/python.</p>
  
  <p><code>Sys.setenv(RETICULATE_PYTHON = ".venv/python")</code></p>
  
  <p>Restart R.</p>
  
  <pre><code>print("hello")
  </code></pre>
  
  <blockquote>
    <p>Error in py_discover_config(required_module, use_environment) : 
    Python specified in RETICULATE_PYTHON (.venv/python) does not exist</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>