7

I am not able to knit html, pdf, or word. Same error each time:

"C:/Users/bosr/AppData/Local/Pandoc/pandoc" +RTS -K512m -RTS test.utf8.md --to docx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output test.docx --highlight-style tango 
pandoc.exe: test.utf8.md: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1
Execution halted

I know there are many questions of this nature, but none that I have found have fixed my issue.

I installed R 3.6.1 and RStudio 1.2.1578 on a new Win 10 machine w/o admin rights. Managed to get everything working except Rmarkdown. My sessionInfo() is below. If I open a command prompt, pandoc is findable:

C:\>pandoc --version
pandoc 2.7.3
Compiled with pandoc-types 1.17.5.4, texmath 0.11.2.2, skylighting 0.8.1
Default user data directory: C:\Users\bosr\AppData\Roaming\pandoc
Copyright (C) 2006-2019 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

I have pandoc installed at C:\Users\bosr\AppData\Local\Pandoc\

I also tried @kevinushey's solution mentioned here which resulted in a second pandoc install at H:\rstudio-pandoc\

Both pandoc installs are in my path (user) environment variable which I am allowed to set.

I would be very grateful for any suggestions.

- Session info -------------------------------------------------------
 setting  value                       
 version  R version 3.6.1 (2019-07-05)
 os       Windows 10 x64              
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United States.1252  
 ctype    English_United States.1252  
 tz       America/New_York            
 date     2019-09-24                  

- Packages -----------------------------------------------------------
 package   * version date       lib source                      
 base64enc   0.1-3   2015-07-28 [1] CRAN (R 3.6.1)              
 digest      0.6.21  2019-09-20 [1] CRAN (R 3.6.1)              
 evaluate    0.14    2019-05-28 [1] CRAN (R 3.6.1)              
 glue        1.3.1   2019-03-12 [1] CRAN (R 3.6.1)              
 highr       0.8     2019-03-20 [1] CRAN (R 3.6.1)              
 htmltools   0.3.6   2017-04-28 [1] CRAN (R 3.6.1)              
 jsonlite    1.6     2018-12-07 [1] CRAN (R 3.6.1)              
 knitr       1.25.1  2019-09-24 [1] Github (yihui/knitr@11ddfc6)
 magrittr    1.5     2014-11-22 [1] CRAN (R 3.6.1)              
 markdown    1.1     2019-08-07 [1] CRAN (R 3.6.1)              
 mime        0.7     2019-06-11 [1] CRAN (R 3.6.0)              
 Rcpp        1.0.2   2019-07-25 [1] CRAN (R 3.6.1)              
 rmarkdown   1.15    2019-08-21 [1] CRAN (R 3.6.1)              
 stringi     1.4.3   2019-03-12 [1] CRAN (R 3.6.0)              
 stringr     1.4.0   2019-02-10 [1] CRAN (R 3.6.1)              
 tinytex     0.16    2019-09-17 [1] CRAN (R 3.6.1)              
 xfun        0.9     2019-08-21 [1] CRAN (R 3.6.1)              
 yaml        2.2.0   2018-07-25 [1] CRAN (R 3.6.0)              

[1] C:/Users/bosr/R/R-3.6.1/library
[2] C:/pit

Update: I had IT install pandoc using the admin password, and I am still getting the same error:

"C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS riskNotes.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output riskReport_20190925.tex --table-of-contents --toc-depth 2 --template "C:\Users\bosr\R\R-3.6.1\library\rmarkdown\rmd\latex\default-1.17.0.2.tex" --no-highlight --pdf-engine pdflatex --variable graphics=yes --variable "compact-title:yes" 
pandoc.exe: riskNotes.utf8.md: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1
In addition: There were 22 warnings (use warnings() to see them)
1
  • For me an easy solution was to remove all spaces in named chunks. I use underscore to join words in the names, but some had trailing spaces. For large documents, Rstudio may have gone as far as generating the markdown *.md file, an you can continue from it in rmarkdown::render(my_md_file.md) , but you have to rename the intermediate files in the png's folder for the project. hope it helps
    – markcelo
    Dec 21, 2021 at 20:40

3 Answers 3

Reset to default

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

3

Ok, I see now this is due to the file being saved on a network drive. See here. There is no fix yet. Too bad.

2
  • By "the file", do you refer to the .Rmd that you are trying to knit? Mar 5, 2020 at 9:43
  • 2
    Yes, if the .Rmd file is on a local drive it knits file, but if it is on a network drive, you get a cryptic error that "openBinaryFile: does not exist". I just tried it again with R 3.6.2 and rmarkdown_2.1. Mar 6, 2020 at 15:07
1

I have had a similar error and resolved it by uninstalling all stand-alone versions of Pandoc. In my case I had a separate Pandoc version 2.9.2.1 installed, verified by running the following in R Studio:

rmarkdown::pandoc_version()
# 2.9.2.1
rmarkdown::pandoc_exec()
# "C:/Program File~/pandoc/pandoc"

Uninstalling this version allowed me to render even network files and yielded the folowing after a reboot:

rmarkdown::pandoc_version()
# 1.19.2.1
rmarkdown::pandoc_exec()
# "C:/Program Files/RStudio/bin/pandoc/pandoc"
3
  • I also had a separate version of pandoc installed, but your solution didn't work for me. Using the latest version of Rstudio 1.3.959 I get a much higher versionof pandoc: rmarkdown::pandoc_version() [1] ‘2.7.3’ rmarkdown::pandoc_exec() [1] "C:/Users/bosr/RStudio/bin/pandoc/pandoc" Jun 25, 2020 at 11:33
  • 1
    Strange you have a higher version of Pandoc since I have a higher version of Rstudio (1.1.463) and thought I updated all packages with a recent installation of R 4.0.1. My version for rmarkdown is 2.3.1
    – RDavey
    Jun 25, 2020 at 12:26
  • Strange indeed @RDavey. I updated R to 4.0.2, R-Studio to 1.3.1056, Pandoc still 2.7.3, and still no joy. As far as I can tell this is the version of Pandoc that comes with Rstudio and is the only version installed. My network drive is also mapped to a drive letter.. Jul 17, 2020 at 14:55
1

I had the same problem. The reason was that there was an old .RHistory file in the same folder as the RMarkdown document, which was taken over into a new project due to copying an old folder. By deleting this .RHistory file, I was able to fix the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.