Open Ada-Nick opened 2 years ago
@Ada-Nick Would you be able to create a small piece of code that reproduce the error?
A bit difficult as we need a python module but I have updated the response with an extended example
Looking into it a bit further, it seems that the crash only occurs when importing a sub python module within the python_module/test_function.py file such as:
import scipy.interpolate
def show_message(message):
return message
@Ada-Nick Could you run source("start.R")
from within the terminal tab of the IDE? (Or even the Terminal application.)
I'm trying to see if plumber
is causing R to quit. Or if the IDE is having issues. Thank you!
@schloerke Do you mean in the R studio console? Doing doesn't give any information, the plumber api start up as normal and the termination happens on close.
@Ada-Nick I'm referring to the Terminal panel. See https://support.rstudio.com/hc/en-us/articles/115010737148-Using-the-RStudio-Terminal-in-the-RStudio-IDE#send .
The IDE is tightly integrated with the R eco system. By running the code in the Terminal panel, those connections are at a minimum. (Where as the IDE knows a lot about the regular R console.)
@Ada-Nick I tried using these files ... slightly modified from your setup for example with regards to the call to "import_from_path". Using a plumber container to run it (no RStudio) seems to work, hopefully reproducibly, when using the docker-compose.yml in this repo.
@mskyttner Hi, sorry I had forgotten about this. This is the solution I went with as well. Thanks for your work on the plumber package!
System details
Example application or steps to reproduce the problem
A plumber api I'm working on is dependent on a python module that we're developing, which is in a sub folder of the project directory:
Within start.R I am sourcing global.R which loads a number of R packages and uses the reticulate import_from_path() function to load the python module.
The plumber process is started within start.R :
Everything is working as expected. But when I stop the plumber process by hitting ESC my R session is aborted with a fatal error and causing me to start a new R session.
I am using the latest reticulate and plumber packages and R studio 1.4.1103
EDIT: A more reproducible example, difficult as we need an entire repo:
global.R
start.R
plumber.R
setup.py
python_module/test_function.py
init.py