在Rmarkdown中Python代码在代码块内可以运行,并生成图片,但是serve site时报错,并且会一直循环执行不停报错。理由是:
Error in png::readPNG(path, native = TRUE, info = TRUE) :
unable to open 2019-03-16-numpy鍩虹-鏁扮粍鍜岀煝閲忚绠梍files/figure-html/unnamed-chunk-86-1.png
Calls: local ... lapply -> FUN -> raster_dpi_width -> attr -> <Anonymous>。。。。。
同样的文档里用R写的代码图片可以serve site 成功。但Python就不行了,请问这种情况该怎么处理?
sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)China.936 LC_CTYPE=Chinese (Simplified)China.936
[3] LC_MONETARY=Chinese (Simplified)China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 bookdown_0.9 lattice_0.20-38 packrat_0.5.0 digest_0.6.18
[6] later_0.8.0 mime_0.6 grid_3.5.2 R6_2.4.0 jsonlite_1.6
[11] magrittr_1.5 evaluate_0.13 blogdown_0.11 stringi_1.4.3 rstudioapi_0.9.0
[16] promises_1.0.1 Matrix_1.2-16 reticulate_1.11.1 rmarkdown_1.11 tools_3.5.2
[21] servr_0.13 stringr_1.4.0 httpuv_1.5.0 xfun_0.5 yaml_2.2.0
[26] compiler_3.5.2 htmltools_0.3.6 knitr_1.22