I have read multiple articles along this line, but they all use conda to install R. I am not using conda; I have Windows Subsystem for Linux installed. I was successfully able to install Python, create a virtual environment, and install and run jupyter notebook in that virtual environment.
I installed R in WSL, then activated my virtual environment and ran R with "sudo R" because I was getting a permissions issue. I was able to install IRkernel, but I get an error when I run this:
IRkernel::installspec(user=FALSE)
The error message is: "jupyter-client has to be installed but 'jupyter kernelspec --version' exited with code 127".
I thought it might be a path error, so I used this:
Sys.setenv(PATH="everything from getenv:/path-to-virtual-env/bin")
Tried using installspec again but got the same 127 error.
I'm concerned that it might be because of where I put my virtual environment. To access your files on Windows from within WSL, you have to go to "/mnt/c/Users/your-username/". That's where my virtual environment is, and I'm wondering if that's why R can't see it even when I explicitly tell R where it is. Any help is appreciated.
question from:
https://stackoverflow.com/questions/65925597/how-do-i-make-the-r-kernel-available-to-jupyter 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…