尝试为jupyter设置R-kernel,但是我得到以下错误:,
我正在按照https://github.com/IRkernel/IRkernel上的说明操作,
但是,它在install.packages(“devtools”)上失败。
checking for gawk... gawk
checking for curl-config... /usr/bin/curl-config
checking for the version of libcurl... 7.19.7
checking whether libcurl is usable... no
checking for struct stat.st_mtim... no
checking for struct stat.st_mtimespec... no
checking for struct stat.st_mtime_nsec... no
checking for futimens... no
checking for qsort_r... no
checking for qsort_s... no
----- Results of the git2r package configure -----
OpenSSL to talk over HTTPS...........: yes
LibSSH2 to enable the SSH transport..: no
--------------------------------------------------
configure: creating ./config.status
config.status: creating src/Makevars
** libs
/home/sheetal/software/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -I/home/sheetal/software/anaconda3/lib/R/include -DNDEBUG -I. -Ilibgit2/src -Ilibgit2/include -Ilibgit2/deps/http-parser -D_FORTIFY_SOURCE=2 -O2 -I/home/sheetal/software/anaconda3/include -DGIT_ARCH_64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DGIT_OPENSSL -DLIBGIT2_NO_FEATURES_H -DGIT_SHA1_OPENSSL -DGIT_USE_NSEC -D_FORTIFY_SOURCE=2 -O2 -I/home/sheetal/software/anaconda3/include -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -I/home/sheetal/software/anaconda3/include -c git2r.c -o git2r.o
make: /home/sheetal/software/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc: Command not found
make: *** [git2r.o] Error 127
ERROR: compilation failed for package ‘git2r’
* removing ‘/home/sheetal/software/anaconda3/lib/R/library/git2r’
ERROR: dependency ‘git2r’ is not available for package ‘devtools’
* removing ‘/home/sheetal/software/anaconda3/lib/R/library/devtools’
The downloaded source packages are in
‘/tmp/RtmpJ1BaT2/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("devtools") :
installation of package ‘git2r’ had non-zero exit status
2: In install.packages("devtools") :
installation of package ‘devtools’ had non-zero exit status
最佳答案
据我所知,安装IRkernel的最佳方法是使用anaconda。
在我的mac电脑中(我想Linux和Windows上是一样的),我输入了:
conda install -c r r-irkernel
然后我开始打字:
R
最后,我安装了kernelspec来告诉Jupyter关于IRkernel的事情,在全局环境中安装的选项是user=FALSE:
IRkernel::installspec(user=FALSE)
希望有帮助!