Setting and Running Python with Reticulate Package in RStudio for Windows OS

preview_player
Показать описание
In this video, I will walk through steps to set up a python environment in a RStudio project directory. I used the Windows 10 OS.
#python , #RStudio , #reticulate

Steps:
1. PREREQUISITE - anaconda ready, correct path to python in Windows PATH
2. TEST WINDOW AND PYTHON CONNECTION
3. CREATE NEW RSTUDIO PROJECT
4. INSTALL VIRTUALENV
5. CREATE A NEW ENV
6. ACTIVATE ENV
7. INSTALL PYTHON LIBRARIES
8. Create .Rprofile file

A comment from Dr David Hopp (Thanks Dr Hopp) below:

It turns out that even after following your directions I still had a problem. It was with the PATH variable, that left-over from thirty-five years ago. My problem with the local PATH was two-fold. First, I had done some python/miniconda installs, which I uninstalled, but good old PATH still had pointers to python, and when Windows couldn't find that folder, it defaulted to offer the python app from Windows Store. I got rid of that (after hunting it down) and then trying to run pip didn't work (stackexchange helped with that in some old questions). I had the path to miniconda3 in my PATH but I had to add others too as per C:\Users\cassi\miniconda3; C:\Users\cassi\miniconda3\Scripts;
C:\Users\cassi\miniconda3\Library\bin

That was a critical step. Every once in a while there is a rumor that MS will get rid of PATH, but it hasn't happened yet. If you have the opportunity to add these PATH suggestions as a note it might help others save time. Once again, please accept my gratitude for your video.

Best regards
David Hopp, Ph.D.
Рекомендации по теме
Комментарии
Автор

All was going well until 15:19. The moment I reconfigured, the R session aborted due to a fatal error. The session was terminated. This happens each time.

SHDEdits
Автор

I can't see the new folder being created!! (.env)

khushdeepkaurnagi
Автор

Sorry, this might be a late comment.. Do i have to install the libraries each time i start a new project ?

analyticshome
Автор

Mr. Kim. Tons of thanks! I was able to get reticulate and the python environment functioning. Before, I was simply attempting to call python in reticulate. Failed. Your presentation was just what I was looking for. Plus, I got to play with an old friend - MS DOS. (Maybe it's not called that anymore).

williamhenry
Автор

Virtual environment created through Anaconda CMD, and I can see the .env folder in my R project. But I am not able to activate this environment through Anaconda CMD

akanshasingh
Автор

I have still got a problems with running code chunks (Session Abort). It's my 100 attempt to make it work. What I've tried already is: installing github version; installing different conda environments; reinstalling Rcpp; updating R and Rstudio; setting different environment paths and few more. If someone coped with similar problems, please let me know.

janandrosiuk
Автор

> reticulate::py_config()
Error: Your current architecture is 64bit; however, this version of Python was compiled for 32bit.
Use if you'd like to install a Miniconda Python environment.
In addition: Warning message:
In dir.create(tempPath, recursive = TRUE) :
cannot create dir 'C:\', reason 'Permission denied'
🤦‍♂️🤦‍♂️🤦‍♂️😢😢😢

animeshnegi
join shbcf.ru