I am using R markdown and reticulate package.After running a simple 2 line python code in a chunk,I cant use the python variable in the R chunk using the py$x function.I get the following error: "Error: object 'py' not found"
I have already tried another function py_to_r for converting python objects to R but even that doesnt work cause it throws an error that it cant find the object.I am including python configuration also:
```{r}
py_config()
```
python: C:\Users\chatsh02\AppData\Local\CONTIN~1\ANACON~1\python.exe
libpython: C:/Users/chatsh02/AppData/Local/CONTIN~1/ANACON~1/python36.dll
pythonhome: C:\Users\chatsh02\AppData\Local\CONTIN~1\ANACON~1
version: 3.6.3 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]
Architecture: 64bit
numpy: C:\Users\chatsh02\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\numpy
numpy_version: 1.14.2
python versions found:
C:\Users\chatsh02\AppData\Local\CONTIN~1\ANACON~1\python.exe
C:\Users\chatsh02\AppData\Local\Continuum\anaconda3\python.exe
C:\Users\chatsh02\AppData\Local\Continuum\anaconda3\envs\r-reticulate\python.exe
```{r}
library(reticulate)
use_virtualenv('r-reticulate')
py_available(TRUE)
```
```{python}
a=7
print(a)
```
```{r}
py$a
```
Expected results should be I should be getting R variable a with value 7.Actual result: Error: object 'py' not found