采用网上的办法添加R到jupyter notebool中 但是在最后一步失败。网上未搜索到有用的办法。
报错信息为:> IRkernel::installspec()
Error in IRkernel::installspec() :
jupyter-client has to be installed but “jupyter kernelspec --version” exited with code 1.
问了朋友说可能是没有配置环境变量,个人参考了这个帖子操作https://blog.csdn.net/qq_38106472/article/details/85844803
这个要分两种情况——
1、一种是在CMD命令行运行 IRkernel::installspec()命令,此时要注意:
(1)检查是否把R添加进了环境变量;
(2)是否把 Anaconda的环境配置正确了,包括Anaconda3\Scripts,Anaconda3,Anaconda3\Library等环境变量;
2、一种就是不要再CMD或者Rgui,更不要在Rstudio里运行这个命令,打开Anaconda prompt,在里边运行R,确保R的环境变量添加了;
https://blog.csdn.net/guoyuzhu_2013/article/details/106604447?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522161426399816780261938350%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=161426399816780261938350&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_v2~rank_v29-1-106604447.pc_search_result_no_baidu_js&utm_term=++jupyter-client+has+to+be+installed+but+%E2%80%9Cjupyter+kernelspec+--version%E2%80%9D+exited+with+code+127.参考这篇博文