7

I was trying to install Knitr package in Lyx but I encountered the following error.

"The module knitr requires a package that is not available in your Latex installation or a converter that you have not installed. Latex output may not be possible. Package missing Knitr>latex."

I would greatly appreciate if you could please help me to fix this problem. I checked the Lyx module but couldn't figure out exactly what to do. I am a new user to Lyx and Knitr.

Thank you in advance

2
  • 2
    I wasn't the downvote, but I'm wondering if it was because you included no information about your OS, Lyx, knitr, and R versions, ... or how you installed Latex, ... or possibly just because you capitalized 'knitr' and attention to case is crucial in R?
    – IRTFM
    Sep 16, 2012 at 23:37
  • Sorry for the lack of details. I am using Windows Vista, R 2.15.1, Lyx 2.0.4, and MikTex 2.9.
    – Metrics
    Sep 16, 2012 at 23:53

3 Answers 3

8

That is often an indication of the PATH problem; see the first section of the LyX/Sweave/knitr manual (link to PDF is at http://yihui.name/knitr/demo/lyx/)

7
  • Thanks for the help. It worked. However, Lyx also requires me to change the path when I want to insert the excel file using gnumeric spreadsheet. This means that I can't work on Lyx if I want to run simultaneously both of these packages (knitr and gnumeric spreadsheet). Please correct me if I am wrong.
    – Metrics
    Sep 17, 2012 at 12:32
  • I mean PATH instead of path: en.wikipedia.org/wiki/PATH_(variable) I think it is irrelevant to the path of the spreadsheet file.
    – Yihui Xie
    Sep 17, 2012 at 18:31
  • Thanks Yihui. Yes, I am talking about the PATH in both the cases.
    – Metrics
    Sep 20, 2012 at 23:16
  • 1
    @user1493368 I cannot reproduce the problem under Ubuntu. But I think you can export the spreadsheet to csv, read it into R and reproduce the data table with the xtable package. That said, I still do not understand how the two modules can possible conflict with each other...
    – Yihui Xie
    Sep 21, 2012 at 1:30
  • 1
    @user1493368 Yes I know we can import gnumeric spreadsheets into LyX directly. Based on your description, my guess is you removed the path of gnumeric, which is unnecessary. For Windows, you should be able to put two paths separated by ; in LyX's preferences. They do not conflict with each other. The PATH field in the preferences is not supposed to contain one path only.
    – Yihui Xie
    Sep 21, 2012 at 23:05
2

I had this same error message on my Windows 10 machine and found that the error was in the path I provided for R. If you don't have the path all the way to the R executable, it will not work. Change the path in Lyx with Tools>Preferences>Paths and edit the PATH prefix content. I had to add

                C:\Program Files\R\R-3.6.0\bin\x64
1

Ahem... In Windows 10, using MikTeX, you should be aware that R installs under x64 and i386 architecture so that when you run R.home('bin') in R it gives:

"C:/Users/DIEGOA~1.ACO/DOCUME~1/R/R-34~1.2/bin/i386" for i386 architecture and "C:/Users/DIEGOA~1.ACO/DOCUME~1/R/R-34~1.2/bin/x64" for x64 architecture... You should test both when adding the Rnw(knitr) in LyX (One complains, the other doesn´t)...

Hope this helps...

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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