-
Notifications
You must be signed in to change notification settings - Fork 628
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
save_image not working. 'sys' is not defined in py_run_string_impl #2179
Comments
This seems to be some kind of regression with latest reticulate 1.26. It was also reported on Stack Overflow. With reticulate 1.25 it works as usual: remotes::install_github("rstudio/reticulate@v1.25")
#> Using github PAT from envvar GITHUB_PAT
#> Downloading GitHub repo rstudio/reticulate@v1.25
#>
#> * checking for file ‘/tmp/RtmpIYtuHK/remotes13a887430565e/rstudio-reticulate-38978a1/DESCRIPTION’ ... OK
#> * preparing ‘reticulate’:
#> * checking DESCRIPTION meta-information ... OK
#> * cleaning src
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * building ‘reticulate_1.25.tar.gz’
#> Installing package into '/home/salim/.by_pkg_mngr/r'
#> (as 'lib' is unspecified)
library(plotly)
#> Loading required package: ggplot2
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
p <- plot_ly(x = 1:10)
save_image(p, "./pic.png")
#> No trace type specified:
#> Based on info supplied, a 'histogram' trace seems appropriate.
#> Read more about this trace type -> https://plotly.com/r/reference/#histogram Created on 2022-09-07 with reprex v2.0.2 A workaround for reticulate 1.26 is to call install.packages("reticulate")
#> Installing package into '/home/salim/.by_pkg_mngr/r'
#> (as 'lib' is unspecified)
library(plotly)
#> Loading required package: ggplot2
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
p <- plot_ly(x = 1:10)
reticulate::py_run_string("import sys")
save_image(p, "./pic.png")
#> No trace type specified:
#> Based on info supplied, a 'histogram' trace seems appropriate.
#> Read more about this trace type -> https://plotly.com/r/reference/#histogram Created on 2022-09-07 with reprex v2.0.2 |
This has worked for me: library(reticulate) Thanks a lot! |
#Error in py_run_string_impl(code, local, convert) : |
Fixed by #2228 |
Trying the kaleido example, I get this error and no picture.
The text was updated successfully, but these errors were encountered: