I have already installed Jupyter notebook in my ubuntu 16.04 machine. In jupyter notebook there is by default python installed. Now I want to use R from jupyter notebook.
I had the same error, but in my case, I have jupyter installed in a virtual environment, so I had to start R after installing the virtual environment in order for IRkernel::installspec() to succeed.
For mac users:
I came across the same problem. You should call IRkernel::installspec(user = FALSE)
in the terminal through R. I solved it this way, and I bet you could do the same:
R.home()
in R console[1] "/Library/Frameworks/R.framework/Resources"
/bin/R
to path nlike this: /Library/Frameworks/R.framework/Resources/bin/R
/Library/Frameworks/R.framework/Resources/bin/R
and enter.IRkernel::installspec(user = FALSE)
And it shall be solved then.I tried to install IRkernel on my Windows machine. I experienced a similar problem when I ran from within R:
> IRkernel::installspec(user = FALSE)
Error in IRkernel::installspec(user = FALSE) :
jupyter-client has to be installed but “jupyter kernelspec --version” exited with code 1.
I did not use conda to install Jupyter on my machine, but pip. I have some programmes installed which use python under the hood. It means that I have more than one Python instance on my machine and more Jupyter instances too. To be sure I was referencing the right Jupyter instance, I did this:
> setwd('C:/usr/lib/Python36-32/Scripts')
> IRkernel::installspec(user = FALSE)
[InstallKernelSpec] Installed kernelspec ir in C:\ProgramData\jupyter\kernels\ir
Besides Python, I can now also use R within my notebooks.
I had the same error but the fix was different:
Make sure you also have anaconda install on your system! (or at least jupyter) https://conda.io/docs/user-guide/install/index.html
I had the same problem but none of the above solutions worked for me. I was using Debian 9 with the default versions of python and R. I had to delete installed programs and compile latest versions of both from source. For Python compiling I had to use this configuration https://github.com/sloria/TextBlob/issues/173
For Windows Users, After installing anaconda, you should restart your system so Anaconda prompt appears on start. After opening Anaconda Prompt enter
IRkernel::installspec()
This time it will works since I think restart 'cuz PATH of the system to be upgraded.