R Session Aborted on plot$plot(x,y)

Hi, I tried the below code:

knitr::opts_chunk$set(echo = TRUE)
library(reticulate)
use_condaenv(condaenv = "py3", conda = "/home/itamar/dev/apps/miniconda3/bin/conda")
numpy <- import("numpy")
plot <- import("matplotlib.pyplot")
x <- numpy$arange(0.1, 2.0, 0.1)
y <- x^2
plot$plot(x,y) # <---- R Session Aborted Here

When python$python(x,y) runs rstudio shows:

R Session Aborted
R encountered fatal an error
The session was terminated

When I run the same as python code its fine.

it's a clean ubuntu installation with clean anaconda installation (installed all today):

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04 LTS"

Our experience has been that attempting to use matplotlib with Anaconda Python doesn't work well due to incompatible versions of Qt between RStudio and Python being loaded:

We still don't fully understand the issue (nor why matplotlib is attempting to use Qt) but we're tracking the underlying issue there.

1 Like

Thank you. RStudio is awesome. :slight_smile: I have recently posted first few questions like this one on the forum and I have to say that I was struck by the responsiveness and professionalism.

3 Likes