I'm used to R, but new to R markdown. I would like to insert python chunks in the code. However, I cannot get it to work. Every time I press "Knit", it starts knitting until it hits the first python chuck. Then it just pauses, without providing an error message.
I've tried using many example codes setting up a python engine with reticulate and knitr from the internet, but none of them work. I've specified different python files, versions, etc. It seems like I'm missing something, but I cannot figure out what it is.
The code I've used:
---
title: "Test3"
author: "Stanny"
date: "11 september 2019"
output: pdf_document
#
---
## Set-up
```{r setup, include=FALSE}
library(knitr)
knitr::opts_chunk$set(echo = TRUE)
library(reticulate)
use_python("C:\\Users\\STANNY~1\\OneDrive\\envs\\wiki\\python.exe")
```
## A normal R code chunk
```{r}
library(reticulate)
x = 42
print(x)
```
## A Python chunk
```{python}
x = 42 * 2
print(x)
```
## Modify a Python variable
```{python}
x = x + 18
print(x)
```
The output:
processing file: test3.Rmd
|........ | 12%
ordinary text without R code
|................ | 25%
label: setup (with options)
List of 1
$ include: logi FALSE
|........................ | 38%
ordinary text without R code
|................................ | 50%
label: unnamed-chunk-1
|......................................... | 62%
ordinary text without R code
|................................................. | 75%
label: unnamed-chunk-2 (with options)
List of 1
$ engine: chr "python"