I had a quite frustrating time setting up Rstudio dev Version 1.4.1714 on a new PC / windows yesterday - (I am using the dev version due to this bug, but the problem appears also with 1.3.1390 version.
I am stuck due to the following problem : python chunks produce figures that are all labelled with the same label. Does anyone met this problem yet ?
Here is a Rmarkdown example to reproduce this problem on my PC
---
output:
pdf_document: default
html_document: default
---
```{r setup, include=FALSE}
library(reticulate)
```
```{python}
import matplotlib.pyplot as plt
plt.plot([1,2])
```
```{r}
x<-2
```
```{python}
plt.plot([7,8])
```
Output on my machine is
Note that two figures were created but the second plot erased the first. While generating the latex, one can see that the same reference is created for both figures.
EDIT: I just found a workaround. It seems that the problem came with the newer reticulate version 1.20. Thus the workaround is : reverse to reticulate version 1.16 :
remove.packages("reticulate")
require(devtools)
install_version("reticulate", version = "1.16")