save_image Error
未关闭
还没有人认领这个 Issue。
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 plotly::save_image(p, tmp) 开始,跟踪 kaleido()$transform 到 reticulate::py_run_string(load_json);使用所示的临时路径在 Windows 上复现该失败。完成标准是 JSON 成功加载,并且 save_image 写入 PNG 时不会出现 Python unicodeescape 错误。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python, r
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100