save_image Error
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
Dear All,
I am using R 4.6, and i run the following code
reticulate::use_python(reticulate::install_python())
reticulate::py_require(c("kaleido", "plotly"))
p <- plot_ly(x = 1:10)
tmp <- tempfile(fileext = ".png")
save_image(p, tmp)
I get the following error
Error in py_run_string_impl(code, local, convert) :
File "<string>", line 1
import json; fig = json.load(open('C:\Users\310677\AppData\Local\Temp\Rtmpq0iC7T\filec73864b9a23.json'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
Run `reticulate::py_last_error()` for details.
then i run r reticulate::py_last_error()
Please advise.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at plotly::save_image(p, tmp), following kaleido()$transform into reticulate::py_run_string(load_json); reproduce the failure on Windows with the shown temporary path. Done means the JSON loads successfully and save_image writes the PNG without the Python unicodeescape error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100