Rmarkdown file with Python Engine

I am looking to create a dashboard using IPython through .Rmd file and here is my code. The object my_dboard.get_preview() should produce a blank template, however, the output is “## <IPython.core.display.HTML object>” which, makes me think that the python engine is not working. So if I am correct, how do I enable the python engine for Hugo websites otherwise, any help would be appreciated.

---
title: Dash Board with Python Engine
author: Conrad Thiele
date: '2019-05-13'
slug: dash-board-py
categories: []
tags: []
image:
  caption: ''
  focal_point: ''
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r, libraries}
library(reticulate)
```


```{python, imports}
import plotly.dashboard_objs as dashboard
import IPython.display
from IPython.display import Image
```

```{python, create-objs}
my_dboard = dashboard.Dashboard()
my_dboard.get_preview()

```

```{python, components}
    box_1 = {
    'type': 'box',
    'boxType': 'plot',
    'fileId': 'PlotBot:1296',
    'title': 'scatter-for-dashboard'


}
```

Can you give some background of what you referred to in the first place, when you set this up? I am not sure if this is something that should be supported here, or elsewhere. It seems like a special case.

yeap, no probelm, I created a hugo webite through RStudio, basically download the template for hugo - academic from github. Now, I have written a post in Rmarkdown, worked fine. I decided to use Rmarkdown but this time incorporate python code in the form of a Dash board, as my python coding is a bit rusty. Now Rmarkdown support python code (see here) , as the code chunks are very similar, however, you do have to install an R library for this called “reticulate”.

```{r, libraries}
    library(reticulate)
    # normally you would put the PATH to python application
```

Now I can not imagine it would be any good pointing my local C:\User\filename\python repository as I run the Hugo through Github using Netlify.

So then I wondered if Hugo has a python application that sits in the full stack to run python objects. Hopefully that clarifies things a bit, sorry for being a pain.

ps File structure to give you an idea of the project.

Never mind, it is probably easier to embed a graph instead.

It doesn’t. If you’re meant to put the python path, and you’re building on netlify, then you need to find out what that should be on netlify, not your local machine.

1 Like