I've been looking around for an answer on this for a while but I haven't found any answers. I'm more familiar with R than with python, and I would prefer to use the python package of my company in RStudio rather than Jupyter Notebook. That's why I looked around a bit and found the reticulate package for R to interface R with Python. I've been able to import the company package and call help for python classes of that package ex:
py_help(dev$Report)
Everything works fine. However, when I try to use the Report class as follows
py_run_string('report = Report.from_csv(x)')
python returns this error
NameError: name 'Report' is not defined
When I source a python script
source_python("file_path/script.py")
It gives me the same error. I got a bit more creative then and tried something like this
report <- Report$`from_csv`(x)
This returns another error
Error: object 'Report' not found
I also tried this using repl_python()
, but nothing works. I'm using the same conda environment as I would in Jupyter (where everything works fine) and it's also the same python version that is used. I'm confused by the fact that the package is loaded and I'm able to call help about this package. My hope is that I'm doing something wrong in reticulate or someone who had a similar problem can point me to a solution. Otherwise, I will have to stick to Jupyter. Unfortunately, I cannot share any more information about the companies package itself for obvious reasons. I still hope someone can at least point me in the right direction here.