Skip to content

Commit

Permalink
Fix kaleido command bug (plotly#2228)
Browse files Browse the repository at this point in the history
The line needs access to the Python sys module to run. Otherwise it gives a missing package error.
  • Loading branch information
quinten-goens authored Feb 13, 2023
1 parent 7fb95ed commit e874b86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/kaleido.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ kaleido <- function(...) {
# Write the base64 encoded string that transform() returns to disk
# https://github.com/plotly/Kaleido/blame/master/README.md#L52
reticulate::py_run_string(
sprintf("open('%s', 'wb').write(%s)", file, transform_cmd)
sprintf("import sys; open('%s', 'wb').write(%s)", file, transform_cmd)
)

invisible(file)
Expand Down

0 comments on commit e874b86

Please sign in to comment.