Failing to run Python script from R because of module ImportErrors

787 Views Asked by At

I am trying to call a python script from an R Shiny app. I have tried using the system() function, which enters into the file properly but immediately fails after attempting to import any modules.

system('python /path/to/name_of_file.py')

Traceback (most recent call last): File "< string >", line 2, in < module >
ImportError: No module named praw

I have installed praw using pip install praw, but I still get this error (actually, I get this error with every module that I have installed except for sys). The python script also runs fine from the command line. Does anyone know what I can do to properly integrate my R and python scripts?

0

There are 0 best solutions below