SolvedIRkernel “jupyter kernelspec --version” exited with code 127

Hi, the code

IRkernel::installspec()

I get an error

Error in IRkernel::installspec() : 
  jupyter-client has to be installed but “jupyter kernelspec --version” exited with code 127.

but after I did

conda install -c r r-essentials

on jupyter I can start an R network but

IRkernel::installspec()

still gives the same error. My ultimate aim is to use hydrogen package in atom to run R code but it does not recognize the IRkernel just wondering whether I am missing something.

19 Answers

✔️Accepted Answer

Try starting it from bash and entering R, then running IRkernel::installspec(). It probably won't work when you use the R app icon, because it's not being run by bash, so it won't be affected by bashrc.

Other Answers:

I had encountered a similar issue, the resolution was to start a R session with sudo, execute the below statements

sudo -i R , and then

> Sys.getenv('PATH')
[1] "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/snap/bin"
Sys.setenv(PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/snap/bin:/home/ubuntu/miniconda3/bin')
IRkernel::installspec(user=FALSE)

and thus, the kernel available to all the users.

Hope this helps

When you run IRkernel::installspec(), are you starting R in a terminal or using something like R Studio? Sometimes it can only find Jupyter if you start it in the terminal.

More Issues: