11

I just installed Lyx 2.0.3 on my iMac and MacBook Air. When trying to open a *.lyx document on the iMac I get the following error-message:

"The module knitr has been requested by this document but has not been found in the list of available modules. If you recently installed it, you probably need to reconfigure LyX."

On the MacBook Air everything runs fine without any errors.

Any ideas how to install the knitr-module manually?

Thanks

1 Answer 1

16

The only requirement of the knitr module in LyX is R: you have to make sure the executable Rscript is in your PATH; you can test it by:

which Rscript

If you see the path to Rscript, you are ready to go (Tools-->Reconfigure); otherwise you have to tell LyX where is Rscript (add the path to PATH prefix):

change path in lyx

then reconfigure LyX.

You can get the path to Rscript by executing this in R:

R.home('bin')
5
  • 1
    shouldn't he also do install.packages('knitr') in R ?
    – Xu Wang
    Mar 11, 2012 at 1:37
  • 1
    oh yes, he should, and that is the next step; first he needs to make sure the knitr module is available, and that only requires R to be available
    – Yihui Xie
    Mar 11, 2012 at 2:28
  • 1
    Thanks a lot guys. Worked like a charme.
    – murek
    Mar 11, 2012 at 15:44
  • Where does one need to run which Rscript to test? In the command window? If so, do this assume a particular operating system? Jul 13, 2022 at 2:12
  • Yes, in the command window (if on Windows, use where instead of which).
    – Yihui Xie
    Jul 13, 2022 at 14:03

Your Answer

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.