R Session Aborts when running Python chunk

I'm using Windows and RStudio aborts the session when I try to run a python chunk. I've tried pointing to the python executable in my anaconda folder using use_python.

Code Chunk 1

library(reticulate)
py_config()
use_python("C:/Users/S1855433/AppData/Local/CONTIN~1/ANACON~1/python.exe")

Output 1
python: C:\Users\S1855433\AppData\Local\CONTIN~1\ANACON~1\python.exe
libpython: C:/Users/S1855433/AppData/Local/CONTIN~1/ANACON~1/python37.dll
pythonhome: C:\Users\S1855433\AppData\Local\CONTIN~1\ANACON~1
version: 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
Architecture: 64bit
numpy: [NOT FOUND]

python versions found:
C:\Users\S1855433\AppData\Local\CONTIN~1\ANACON~1\python.exe
C:\Users\S1855433\AppData\Local\CONTIN~1\MINICO~1\python.exe

Then when I try to run my python chunk:
Code Chunk 2

import pandas as pd
import selenium as sn

The first error message that pops up is
image

The second is the message that says I should abort and restart my r session.

I've tried uninstalling anaconda and reinstalling but nothing has worked.

1 Like

I had the same issue a time ago, I filed an issue on github, they told me to update reticulate to the development version and the error went away.

1 Like

Hey how would I install the development version? Currently I'm running version 1.13 for reticulate.
When I run install.packages("rstudio/reticulate") I get:

install.packages("rstudio/reticulate")
Installing package into ‘C:/Users/S1855433/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rstudio/reticulate’ is not available (for R version 3.5.1)
Warning in install.packages :
unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.5:
cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.5/PACKAGES'

To install a package from Github, you cannot use install.packages.

You can use the install_github function in remotes package.

After installing remotes, run this: remotes::install_github("rstudio/reticulate")

I tried that and got this error message. I redownloaded r tools and set it to my PATH and continue to get the same error message.

remotes::install_github("rstudio/reticulate")
Downloading GitHub repo rstudio/reticulate@master
Installing package into ‘C:/Users/S1855433/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)

  • installing source package 'reticulate' ...
    ** libs
    Warning in system(cmd) : 'make' not found
    ERROR: compilation failed for package 'reticulate'
  • removing 'C:/Users/S1855433/Documents/R/win-library/3.5/reticulate'
  • restoring previous 'C:/Users/S1855433/Documents/R/win-library/3.5/reticulate'
    In R CMD INSTALL
    Warning messages:
    1: In missing_devel_warning(pkgdir) :
    Package reticulate has compiled code, but no suitable compiler(s) were found. Installation will likely fail.
    Install Rtools and make sure it is in the PATH.
    2: In i.p(...) :
    installation of package ‘C:/Users/S1855433/AppData/Local/Temp/RtmpaWlJwq/remotes13d46dc12f96/rstudio-reticulate-96421b5’ had non-zero exit status
1 Like

UPDATE: Ignore my comment below. I missed that the poster mentioned installing Rtools.

Have you installed Rtools? You'll need that to be able to compile the reticulate package on Windows (when you use install.packages(), it installs a pre-built binary version from CRAN that therefore does not require compilation).

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.