我是Rmarkdown的新手,正在尝试学习如何编织代码。当我运行示例代码并编织时,它给出了以下错误:
*
Error running filter C:/Users/bbalamdari/Documents/R/win-library/3.6/rmarkdown/rmd/lua/pagebreak.lua:
...uments/R/win-library/3.6/rmarkdown/rmd/lua/pagebreak.lua:18: module 'pandoc.utils' not found:
no field package.preload['pandoc.utils']
no file 'C:\PROGRA~2\Pandoc\lua\pandoc\utils.lua'
no file 'C:\PROGRA~2\Pandoc\lua\pandoc\utils\init.lua'
no file 'C:\PROGRA~2\Pandoc\pandoc\utils.lua'
no file 'C:\PROGRA~2\Pandoc\pandoc\utils\init.lua'
no file 'C:\PROGRA~2\Pandoc\..\share\lua\5.3\pandoc\utils.lua'
no file 'C:\PROGRA~2\Pandoc\..\share\lua\5.3\pandoc\utils\init.lua'
no file '.\pandoc\utils.lua'
no file '.\pandoc\utils\init.lua'
no file 'C:\PROGRA~2\Pandoc\pandoc\utils.dll'
no file 'C:\PROGRA~2\Pandoc\..\lib\lua\5.3\pandoc\utils.dll'
no file 'C:\PROGRA~2\Pandoc\loadall.dll'
no file '.\pandoc\utils.dll'
no file 'C:\PROGRA~2\Pandoc\pandoc.dll'
no file 'C:\PROGRA~2\Pandoc\..\lib\lua\5.3\pandoc.dll'
no file 'C:\PROGRA~2\Pandoc\loadall.dll'
no file '.\pandoc.dll'
Error: pandoc document conversion failed with error 83
Execution halted*
我想也许我应该安装“Pandoc.utils”包,但是一旦我在R中调用了这个包,它就给出了这个错误:
包‘pandoc.utils’不可用(适用于R版本3.6.0)
这是因为我使用的是最新版本的R,而无法安装旧版本的pandoc吗?有人知道这是怎么回事吗?
发布于 2020-02-21 11:22:47
看起来rmarkdown找不到pandoc了。RStudio通常在your\path\to\Rstudio\bin\pandoc中包含pandoc文件。当您打开RStudio时,它会秘密设置一个名为RSTUDIO_PANDOC的环境变量,rmarkdown使用该变量来查找pandoc。
运行命令Sys.getenv("RSTUDIO_PANDOC"),该命令将返回pandoc安装的位置。如果不是这样,那很可能是你的问题。
找到RStudio的安装位置后,可以使用Sys.setenv(RSTUDIO_PANDOC = "your/path/to/Rstudio/bin/pandoc")设置此环境变量。在此之后(假设这是您的问题),您应该能够按预期编织文档。
发布于 2020-03-26 17:54:51
我在我的Windows10桌面上遇到了这个问题,并解决了它。
如果您使用Rstudio,在R Markdown终端中的error之前有一个长命令。它可能看起来像这样:
"C:/Users/15510/AppData/Local/Pandoc/pandoc“...
而且它与 my Sys.getenv("RSTUDIO_PANDOC")不一致,即"C:/Program Files/RStudio/bin/pandoc/pandoc“
所以我从Windows的系统环境中删除了我的pandoc path(C:/Users/15510/AppData/Local/Pandoc/pandoc),然后rmd就可以成功地运行了,终端会说:
"C:/Program Files/RStudio/bin/pandoc/pandoc“...
附言:我猜你已经在你的用户目录中安装了pandoc,也许你可以检查一下你电脑的系统路径。
发布于 2020-06-24 10:01:08
不幸的是,上述方法对我都不起作用。令人惊讶的是,断开与互联网的连接起到了作用。也许这对其他人也有帮助。
https://stackoverflow.com/questions/60331617
复制相似问题