参考了别人的教程在Rstudio中运行了下面两条代码
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
devtools::install_github('IRkernel/IRkernel')
这条报错,和大家一样都是fail
install.packages('IRkernel')
用镜像成功
但是不管是在Rstudio还是R中还是在terminal的R中都不能用installspec函数安装
IRkernel::installspec(user = FALSE)
错误如下
Error in IRkernel::installspec(user = FALSE) :
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) :
error in running command
尝试用另一种安装方法,离谱的事情出现了
conda install -c r r-irkernel
然后我不能从terminal中运行R
错误如下
dyld: Library not loaded: @rpath/libreadline.6.2.dylib
Referenced from: /Users/cpy/miniconda3/lib/R/lib/libR.dylib
Reason: image not found
[1] 2071 abort R
最后我选择conda unstall -c r r-irkernel回到了最初的起点