0

I am trying to use the "reticulate" package in R to run python code in my R script. I have tried to run very simple commands just to see if it is working, and I get the following error every time.

“Error in sys$stdout$flush() : attempt to apply non-function”

I have uninstalled and installed both R and Python to the most up to date versions. I'm not sure what else to do, it seems the reticulate packages definitely works for others and only a few have had this issue with no clear answers as to why.

Please help!

library(reticulate)
py_run_string("import numpy as np")
py_run_string("my_python_array = np.array([2,4,6,8])")

print(my_python_array)
py_run_string("print(my_python_array)")
BonnieB
  • 1
  • 1

1 Answers1

1

This may be the same issue as reported here: https://github.com/rstudio/reticulate/issues/584

In R, you can download the possible fix from the master branch at github:

devtools::install_github("rstudio/reticulate")
vando026
  • 21
  • 3