Kernel Error in R Notebook using Jupyter Notebook

随声附和 提交于 2019-12-04 05:18:32

I was having exactly the same error in Windows 7. I added R to PATH environment variables and I was able to run it on shell but I was still having the kernel error in Jupyter.

The Kernel started working when installed system wide using:

IRkernel::installspec(user = FALSE)

instead of the first installation option:

IRkernel::installspec()

Note that it is necessary to set both parameters, the PATH variable and the R system wide install.

You probably missed the warning up top about a missing index in the irkernel repo:

Warning: unable to access index for repository http://irkernel.github.io/src/contrib:
   cannot download all files

The new installation steps worked for me (in R 3.3 console):

install.packages('devtools')
devtools::install_github('IRkernel/IRkernel') # IRkernel-master.tar.gz
IRkernel::installspec()  # register kernel in the current R install
IRkernel::installspec(name = 'ir33', displayname = 'R 3.3')  # ir32, R 3.2

When you restart jupyter notebook, an "R 3.3" entry should appear in the list of kernels.

If using Windows 10 and not using Anaconda, then try this;

Review your existing kernel file with Notepad. File is located:

~ AppData\Roaming\Jupyter\kernels

This file will show the version of R that was used when Jupyter was installed. If you changed or upgraded the version of R currently being used, then R Kernel will not work in Jupyter.

R Studio -> Tools -> Global Options -> Change , to review versions of R installed on PC. If the current version of R is different than the version in the kernel file, select that other version of R. Close R Studio and reopen to verify version being used. Close R Studio and open Jupyter Notebook and select the R kernel. R kernel should now work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!