0

I am trying to run .py file from RStudio. I installed reticulate package and ran the single line below

reticulate::source_python("IR_Model_Main.py")

This results in the following error, Error in path.expan(path):invalid 'path' argument.I am not sure what this means. Running py_available() yields FALSE but I have anaconda3 through which I use SPyder to run the original .py file.

Can someone please tell me what is wrong?

My .py file is stored in the same project folder I am running RStudio.

I am unable to find python folder under anaconda enter image description here

Din
  • 81
  • 6
  • Can you try pointing R to the location of your Anaconda distribution, e.g. per https://rstudio.github.io/reticulate/articles/versions.html, you can leverage the `use_python` function – jav Oct 06 '22 at 05:17
  • thanks @jav but I can't find the bin/python folder under anaconda3 folder. Added screenshot for reference. – Din Oct 06 '22 at 06:11
  • adding the use_python fuction and pointing it to the executable file still gives Error in path.expan(path):invalid 'path' argument – Din Oct 06 '22 at 06:45
  • Ok, this may be more applicable given your error: https://stackoverflow.com/questions/50145643/unable-to-change-python-path-in-reticulate/51547674#51547674. So restart your session, do `Sys.setenv(RETICULATE_PYTHON = "Path to python.exe")` and then try loading the `reticulate` library once more. – jav Oct 06 '22 at 07:17
  • @jav thanks for your comment. I am still getting the same Error in path.expan(path):invalid 'path' argument – Din Oct 18 '22 at 05:26

0 Answers0