遇到了很多报错,最终也是通过不同方法装成功了。
问题1、提示rJava版本不到Java8
Loading required package: rJava
Error: package or namespace load failed for ‘corehunter’:
.onLoad failed in loadNamespace() for 'corehunter', details:
call: fun(libname, pkgname)
error: Java version 8 or later required. Found version 7.
Execution halted
通过查看环境变量,可以看出我是java8,
which java
/public/System/jre1.8.0_25/bin/java
echo "$JAVA_HOME"
/public/System/jre1.8.0_25
但后来我发现系统有个java版本是java7
/usr/java/latest/bin/java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
所以R并没有正确的识别
问题2、没有root权限
事实上,我卡在rJava安装的这步,这时R解释器给了提示 R CMD javareconf, 我执行后,变成了需要再次执行 并使用 root
Make sure you have Java Development Kit installed and correctly registered in R.
If in doubt, re-run "R CMD javareconf" as root.
ERROR: configuration failed for package ‘rJava’
解决、conda 永远的神
因为要root,我本来已经准备放弃,后来想到,conda也许可以帮忙装环境,搜到了,而且安装成功
image.png
后续,conda 陨落
本来打算一鼓作气用conda装完,结果conda执行完后,提示成功,但却没有corehunter包
image.png
最终,用R的CRAN补了corehunter包
#R语言
install.packages("corehunter")
** testing if installed package keeps a record of temporary installation path
* DONE (corehunter)
The downloaded source packages are in
‘/tmp/RtmpicjoAB/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
> library("corehunter")
Loading required package: rJava
网友评论