'r chunk returns null for variables created in python chunk in R markdown r studio, reticulate in R

I ve seen topics asking for a solution to a similar problem, I tried suggested solution.
no success yet. However, I had no issue until yesterday when suddenly this null problem showed up.
I updated everything to the last version and checked for where my python and r miniconda are installed everything seems ok.
I knit the document first also as suggested in other posts.
I m confused what's going on. when I type py$ the drop-down menu shows up suggesting x, but it returns null.

---
title: "test"
author: "ME"
date: '2022-02-23'
output: html_document
---



```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = F, fig.align = 'center')
knitr::knit_engines$set(python = reticulate::eng_python)
library(reticulate)
#library(cleanrmd)

```

```{python}
import numpy as np
import matplotlib.pyplot as matplot
import pandas as pd


x=2
x   ###returns 2
```

```{r}
py$x  #### returns NULL
```


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source