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)")