Cannot get IRkernel::installspec() to work, jupyter-client not visible

7.8k Views Asked by At

I am still in progress to get Jupyter-Notebook and R working together on Windows 10 machine. After solving the problem with install_github() I am now facing just another issue. I am still following the official installation guide, I am stuck at step 2:

Every time I get this error - I have tried this in R GUI and RStudio, the same:

> IRkernel::installspec()
Error in IRkernel::installspec() : 
  jupyter-client has to be installed but “jupyter kernelspec --version” exited with code 127.
In addition: Warning message:
In system2("jupyter", c("kernelspec", "--version"), FALSE, FALSE) :
  '"jupyter"' not found

My attempts so far: It was suggested here and here, that this could be a problem with the PATH variable setting, so I have added Anaconda to the PATH enviroment. I also installed the jupyter-client via the Anaconda console. No change so far. Any ideas?

5

There are 5 best solutions below

1
On BEST ANSWER

This answer is based on this by @Ryan, but since the question answered was actually about a Linux based system I put it here in a Windows question:

One way to overcome the problem - if adding PATH variables to the environment doesn't work - is the following:

  1. If Anaconda is installed and the Jupyter-Notebook with it (should be the standard install), open up the Anaconda prompt, not the Windows command prompt or the Anaconda Navigator
  2. Look up the executable of R (not Rgui or Rstudio), it should be somewhere like C:\Program Files\R\R-3.5.1\bin and copy the path
  3. Paste the path into the Anaconda prompt and start R by typing R
  4. Now execute IRkernel::installspec() once again, this time there shouldn't be an error
  5. Now you can start an R kernel within Jupyter-Notebook
0
On

I was having this issue trying to run Jupyter Lab on my Ubuntu 18.04 LTS headless server running in an Azure VM.

To resolve the issued, I had to navigate to /usr/bin and open R from there. It turns out that despite my path, calling R from the terminal opened the anaconda3 version in /home/<you>/anaconda3/bin/R.

Run IRkernel::installspec() from /usr/bin/R in as sudo and it should add the kernel.

0
On

Simply create a new virtual environment for R. Either using the CLI or the anaconda Navigator (best recommended, If and if you're using Anaconda).

0
On

If jupyter.exe is installed under c:\python36\sripts, run "setwd("c:/python36/scripts")" on R GUI, run "IRkernel::installspec()"

3
On

You should try to open R in the terminal, if you changed directory where R il located type:

 R.exe 

and then run:

 IRkernel::installspec()