This is my first attempt to mix R and Python, and I'm running into problems when I try to knit the .Rmd with the following chunks:
library(reticulate) reticulate::use_python("/home/XXXXX/.pyenv/shims/python", required=TRUE) py_discover_config() architect <- import_from_path("src", path=here(), delay_load = FALSE)
res <- architect$utils$camera_utils$get_camera_param()
get_camera_param imports a bunch of other modules from throughout src.utils which is why I did the import at the src level. If I run the chunks manually in Rstudio, it works fine. But when I try to knit the file I get the following error:
Quitting from lines 51-52 (plot_camera.Rmd)
Error in py_get_attr_impl(x, name, silent) :
AttributeError: module 'src.utils' has no attribute 'camera_utils'
Calls: ... py_get_attr_or_item -> py_get_attr -> py_get_attr_impl