Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access R variables from Python when running from command line #914

Closed
jbentleyEG opened this issue Dec 30, 2020 · 5 comments
Closed

Comments

@jbentleyEG
Copy link

jbentleyEG commented Dec 30, 2020

The following code works from RStudio but not when using R from the command line and calling 'render' on an rMarkdown notebook.

```{r python}
b <- 2
```

```{python}
print(r.b)
```

When executing from RStudio it prints '2' as expected, but if I run R from the command line it fails with

Error in py_call_impl(callable, dots$args, dots$keywords) :
RuntimeError: Evaluation error: object 'b' not found.

Detailed traceback:
File "", line 1, in
File "/Library/Frameworks/R.framework/Versions/3.6/Resources/library/reticulate/python/rpytools/call.py", line 21, in python_function
raise RuntimeError(res[kErrorKey])

Reticulate v1.16 works as expected, but versions 1.17 and 1.18 are broken. My guess is that it is related to this commit: fcd969e

Related Stack Overflow post (before I realised it was a version issue): https://stackoverflow.com/questions/65511458/reticulate-cant-access-r-variables-in-python-when-knitting-unless-running-in-rs

@kevinushey
Copy link
Collaborator

Do you see this with the development version of reticulate as well? remotes::install_github("rstudio/reticulate")

@jbentleyEG
Copy link
Author

I just tested it, it does appear to be fixed in the current dev version (1.18-9000).

Thank you!

@kevinushey
Copy link
Collaborator

Great, thanks! I'll try to get a new version of reticulate published to CRAN soon.

@jbentleyEG
Copy link
Author

Awesome, thanks for the super quick turnaround

@kevinushey
Copy link
Collaborator

reticulate 1.19 is now on CRAN.

linogaliana added a commit to linogaliana/python-datascientist that referenced this issue Oct 30, 2021
linogaliana added a commit to linogaliana/python-datascientist that referenced this issue Oct 31, 2021
* Relec ka 2210 (#167)

* coquilles webscraping

* coquilles regex

* relecture du cours et TP sur git KA

* relecture KA du TP sur les API

* Update content/course/manipulation/04a_webscraping_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

Co-authored-by: Lino Galiana <33896139+linogaliana@users.noreply.github.com>

* Automated changes

* Automated changes

* Automated changes

* plein de détails

* encore des exemples

* ajoute détails

* Automated changes

* Automated changes

* limite taille print

* update

* Automated changes

* Automated changes

* ajoute une carte leaflet

* Automated changes

* Automated changes

* corrige plot manquant

* afficher folium

* print status

* Automated changes

* Automated changes

* Automated changes

* stylise la carte

* Automated changes

* Automated changes

* customize carte

* Automated changes

* Automated changes

* citer XD

* afficher l'image

* retire de la liste

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Stupid idea to give a variable the name "r" since this is how reticulate makes the passthrough between r and python

see rstudio/reticulate#914

* Automated changes

* Automated changes

* retire image

* Automated changes

* Automated changes

* asis

* Automated changes

* Automated changes

* test compil partie git

* une petite intro

* détails

* on arrange

* copier coller utilitr

* note authent https

* des détails supplémentaires

* eval FALSE

* clean

* premiers elements

* ajoute des éléments

* capture écran

* des modifs

* ajoute image git

* explications

* ajoute option store

* plus de modifs

* reorg

* clean

* partie solo finie

* ajoute éléments dans la partie cours

* ajout header jupytext !

* Automated changes

* Automated changes

* update fichiers

* mef markdown

* change emplacement

* Automated changes

* mef

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* typo

* Automated changes

* Automated changes

* affiche image masquée

* Automated changes

* Automated changes

* révise partie cadavre exquis

* Automated changes

* Automated changes

* corrige typo

* shell

* Automated changes

* Automated changes

* Automated changes

* cette image est mieux

* Automated changes

* Automated changes

Co-authored-by: Kim A <kim.antunez@ensae.fr>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
linogaliana added a commit to linogaliana/test-light-python-datascientist that referenced this issue Oct 12, 2023
* Relec ka 2210 (#167)

* coquilles webscraping

* coquilles regex

* relecture du cours et TP sur git KA

* relecture KA du TP sur les API

* Update content/course/manipulation/04a_webscraping_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

Co-authored-by: Lino Galiana <33896139+linogaliana@users.noreply.github.com>

* Automated changes

* Automated changes

* Automated changes

* plein de détails

* encore des exemples

* ajoute détails

* Automated changes

* Automated changes

* limite taille print

* update

* Automated changes

* Automated changes

* ajoute une carte leaflet

* Automated changes

* Automated changes

* corrige plot manquant

* afficher folium

* print status

* Automated changes

* Automated changes

* Automated changes

* stylise la carte

* Automated changes

* Automated changes

* customize carte

* Automated changes

* Automated changes

* citer XD

* afficher l'image

* retire de la liste

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Stupid idea to give a variable the name "r" since this is how reticulate makes the passthrough between r and python

see rstudio/reticulate#914

* Automated changes

* Automated changes

* retire image

* Automated changes

* Automated changes

* asis

* Automated changes

* Automated changes

* test compil partie git

* une petite intro

* détails

* on arrange

* copier coller utilitr

* note authent https

* des détails supplémentaires

* eval FALSE

* clean

* premiers elements

* ajoute des éléments

* capture écran

* des modifs

* ajoute image git

* explications

* ajoute option store

* plus de modifs

* reorg

* clean

* partie solo finie

* ajoute éléments dans la partie cours

* ajout header jupytext !

* Automated changes

* Automated changes

* update fichiers

* mef markdown

* change emplacement

* Automated changes

* mef

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* typo

* Automated changes

* Automated changes

* affiche image masquée

* Automated changes

* Automated changes

* révise partie cadavre exquis

* Automated changes

* Automated changes

* corrige typo

* shell

* Automated changes

* Automated changes

* Automated changes

* cette image est mieux

* Automated changes

* Automated changes

Co-authored-by: Kim A <kim.antunez@ensae.fr>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
linogaliana added a commit to linogaliana/python-datascientist that referenced this issue Oct 13, 2023
* Relec ka 2210 (#167)

* coquilles webscraping

* coquilles regex

* relecture du cours et TP sur git KA

* relecture KA du TP sur les API

* Update content/course/manipulation/04a_webscraping_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

Co-authored-by: Lino Galiana <33896139+linogaliana@users.noreply.github.com>

* Automated changes

* Automated changes

* Automated changes

* plein de détails

* encore des exemples

* ajoute détails

* Automated changes

* Automated changes

* limite taille print

* update

* Automated changes

* Automated changes

* ajoute une carte leaflet

* Automated changes

* Automated changes

* corrige plot manquant

* afficher folium

* print status

* Automated changes

* Automated changes

* Automated changes

* stylise la carte

* Automated changes

* Automated changes

* customize carte

* Automated changes

* Automated changes

* citer XD

* afficher l'image

* retire de la liste

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Stupid idea to give a variable the name "r" since this is how reticulate makes the passthrough between r and python

see rstudio/reticulate#914

* Automated changes

* Automated changes

* retire image

* Automated changes

* Automated changes

* asis

* Automated changes

* Automated changes

* test compil partie git

* une petite intro

* détails

* on arrange

* copier coller utilitr

* note authent https

* des détails supplémentaires

* eval FALSE

* clean

* premiers elements

* ajoute des éléments

* capture écran

* des modifs

* ajoute image git

* explications

* ajoute option store

* plus de modifs

* reorg

* clean

* partie solo finie

* ajoute éléments dans la partie cours

* ajout header jupytext !

* Automated changes

* Automated changes

* update fichiers

* mef markdown

* change emplacement

* Automated changes

* mef

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* typo

* Automated changes

* Automated changes

* affiche image masquée

* Automated changes

* Automated changes

* révise partie cadavre exquis

* Automated changes

* Automated changes

* corrige typo

* shell

* Automated changes

* Automated changes

* Automated changes

* cette image est mieux

* Automated changes

* Automated changes

Co-authored-by: Kim A <kim.antunez@ensae.fr>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
linogaliana added a commit to linogaliana/python-datascientist-trim2 that referenced this issue Dec 2, 2023
* Relec ka 2210 (#167)

* coquilles webscraping

* coquilles regex

* relecture du cours et TP sur git KA

* relecture KA du TP sur les API

* Update content/course/manipulation/04a_webscraping_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

Co-authored-by: Lino Galiana <33896139+linogaliana@users.noreply.github.com>

* Automated changes

* Automated changes

* Automated changes

* plein de détails

* encore des exemples

* ajoute détails

* Automated changes

* Automated changes

* limite taille print

* update

* Automated changes

* Automated changes

* ajoute une carte leaflet

* Automated changes

* Automated changes

* corrige plot manquant

* afficher folium

* print status

* Automated changes

* Automated changes

* Automated changes

* stylise la carte

* Automated changes

* Automated changes

* customize carte

* Automated changes

* Automated changes

* citer XD

* afficher l'image

* retire de la liste

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Stupid idea to give a variable the name "r" since this is how reticulate makes the passthrough between r and python

see rstudio/reticulate#914

* Automated changes

* Automated changes

* retire image

* Automated changes

* Automated changes

* asis

* Automated changes

* Automated changes

* test compil partie git

* une petite intro

* détails

* on arrange

* copier coller utilitr

* note authent https

* des détails supplémentaires

* eval FALSE

* clean

* premiers elements

* ajoute des éléments

* capture écran

* des modifs

* ajoute image git

* explications

* ajoute option store

* plus de modifs

* reorg

* clean

* partie solo finie

* ajoute éléments dans la partie cours

* ajout header jupytext !

* Automated changes

* Automated changes

* update fichiers

* mef markdown

* change emplacement

* Automated changes

* mef

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* typo

* Automated changes

* Automated changes

* affiche image masquée

* Automated changes

* Automated changes

* révise partie cadavre exquis

* Automated changes

* Automated changes

* corrige typo

* shell

* Automated changes

* Automated changes

* Automated changes

* cette image est mieux

* Automated changes

* Automated changes

Co-authored-by: Kim A <kim.antunez@ensae.fr>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
linogaliana added a commit to linogaliana/python-datascientist that referenced this issue Dec 2, 2023
* Relec ka 2210 (#167)

* coquilles webscraping

* coquilles regex

* relecture du cours et TP sur git KA

* relecture KA du TP sur les API

* Update content/course/manipulation/04a_webscraping_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

* Update content/course/manipulation/04c_API_TP.Rmd

Co-authored-by: Lino Galiana <33896139+linogaliana@users.noreply.github.com>

* Automated changes

* Automated changes

* Automated changes

* plein de détails

* encore des exemples

* ajoute détails

* Automated changes

* Automated changes

* limite taille print

* update

* Automated changes

* Automated changes

* ajoute une carte leaflet

* Automated changes

* Automated changes

* corrige plot manquant

* afficher folium

* print status

* Automated changes

* Automated changes

* Automated changes

* stylise la carte

* Automated changes

* Automated changes

* customize carte

* Automated changes

* Automated changes

* citer XD

* afficher l'image

* retire de la liste

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* Stupid idea to give a variable the name "r" since this is how reticulate makes the passthrough between r and python

see rstudio/reticulate#914

* Automated changes

* Automated changes

* retire image

* Automated changes

* Automated changes

* asis

* Automated changes

* Automated changes

* test compil partie git

* une petite intro

* détails

* on arrange

* copier coller utilitr

* note authent https

* des détails supplémentaires

* eval FALSE

* clean

* premiers elements

* ajoute des éléments

* capture écran

* des modifs

* ajoute image git

* explications

* ajoute option store

* plus de modifs

* reorg

* clean

* partie solo finie

* ajoute éléments dans la partie cours

* ajout header jupytext !

* Automated changes

* Automated changes

* update fichiers

* mef markdown

* change emplacement

* Automated changes

* mef

* Automated changes

* Automated changes

* Automated changes

* Automated changes

* typo

* Automated changes

* Automated changes

* affiche image masquée

* Automated changes

* Automated changes

* révise partie cadavre exquis

* Automated changes

* Automated changes

* corrige typo

* shell

* Automated changes

* Automated changes

* Automated changes

* cette image est mieux

* Automated changes

* Automated changes

Co-authored-by: Kim A <kim.antunez@ensae.fr>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants