Seg fault with reticulate

I'm trying to render a simple Rmd.

  • I can render test.Rmd locally (Ubuntu)
  • But using the Dockerfile below, I get a seg fault


  1. Build image below: docker build . --tag="segfault-reprex"
  2. Try knit the Rmd in the container: docker run segfault-reprex Rscript -e "rmarkdown::render('/root/test.Rmd')"

The file test.Rmd (note I've add two ' to render the knitr backticks):

output: pdf_document

```{r setup}
  envname = "./venv",
  packages = c("matplotlib")

venv_path = file.path(getwd(), "venv")
reticulate::use_virtualenv(venv_path, required = TRUE)

import matplotlib.pyplot as plt
plt.plot([1, 2, 3], [4, 5, 6])


FROM rocker/r-ver:latest
RUN apt update && apt install -y python3.8-venv python3-dev pandoc
RUN Rscript -e 'install.packages(c("reticulate", "rmarkdown"))'
COPY test.Rmd /root/

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.