I am trying to run
pyscript1.py in R using
reticulate. The wrinkle is that
imports another script,
pyscript2.py, which is located in the same directory. If I run
pyscript1.py in python,
import pyscript2 works fine.
However, using reticulate in R,
ModuleNotFoundError: No module named 'pyscript2'. If I remove the import from
pyscript1.py, then no error is thrown with
I am sure there is something specific I am missing about the
reticulate sourcing process, but I am unable to figure out from the documentation or source code what the issue is.
library(reticulate) use_condaenv('myenv', required = TRUE) source_python('/path/to/pyscript1.py')
import pyscript2 dostuff()