How to configure python with Rstudio

Hello

I have installed Rstudio and python 3.8, and as you know I can run python code through Rstudio, but I faced problem I can't do that, because the Rstudio didn't configure with python, so I was forced to install Anaconda Package, then every thing it is ok, but still I need to uninstall anaconda and reinstall the last version of python, but How to configure python with Rstudio

please help me

Best regards

Asiri

In which OS are you on ?
Did you follow advice in reticulate website ?

Configuring python depends on how many version you have on your system, and if it is in the PATH yet or not. You can also use specific version with R
https://rstudio.github.io/reticulate/articles/versions.html

Hope it helps

Thank you so much for your reply

My OS is windows 10

Believe me I lost much time to solve this problem, unfortunately I didn't , and about the the link, I have visited it before, but it wasn't helpful

So please help me

Best Regards

Usually, you have to install a python distribution. On windows, anaconda is better - or miniconda for a lighter install. Test it work as is without R and RStudio

Then you'll have to configure which version of python to use with reticulate using use_* or an environment variable following the doc from reticulate.

If you are familiar with installation fo dev package version (using Rtools on windows), and then want to try dev reticulate version from github, it offers a new help install_miniconda that may be simplify the installation for you. If you never install from github, do not try it, it will be another think to setup. :sweat_smile:

remotes::install_github("rstudio/reticulate")
library(reticulate)
install_miniconda()

See dev function doc here
https://rdrr.io/github/rstudio/reticulate/man/install_miniconda.html

Anaconda has Python version 3.7
So what if I want the latest python version 3.8 how to configure Rstudio with this Python version 3.8

You can upgrade anaconda to python 3.8 if required but needs to take care of the module that don't all support 3.8
https://anaconda.org/anaconda/python

Also, I don't know if reticulate work well on windows with another distribution. You can try : Install the python version you want then configure use_python or environment varaible to the path of you python installation. Did you already try that ? What is the error you get ?