gpt4 book ai didi

r - 安装 RWeka 时遇到问题

转载 作者:太空宇宙 更新时间:2023-11-03 17:09:21 31 4
gpt4 key购买 nike

我一直在尝试通过 ipython notebook 安装 RWeka for R,但出现错误。我有 ubuntu 16.10

我试过以下命令

sudo R CMD javareconf

sudo R

install.packages("rJava",type="source")

"Installing package into ‘/home/shahan/R/x86_64-pc-linux-gnu-
library/3.3’
(as ‘lib’ is unspecified)

Content type 'application/x-gzip' length 656615 bytes (641 KB)

downloaded 641 KB

* installing *source* package ‘rJava’ ...
* package ‘rJava’ successfully unpacked and MD5 sums checked

warning: [options] bootstrap class path not set in conjunction with -
source 1.4

1 warning

/usr/lib/jvm/java-7-openjdk-amd64/jre/../bin/jar fc JRI.jar org
libjri.so
make[2]: Leaving directory

'/tmp/RtmpDMwK9H/R.INSTALL4a885e7a4476/rJava/jri/src'

rm -f libjri.so
cp src/libjri.so libjri.so

/usr/lib/jvm/java-7-openjdk-amd64/jre/../bin/javac -target 1.4 -source
1.4 -classpath src/JRI.jar -d examples examples/rtest.java

warning: [options] bootstrap class path not set in conjunction with -
source 1.4

Note: examples/rtest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

1 warning

/usr/lib/jvm/java-7-openjdk-amd64/jre/../bin/javac -target 1.4 -source
1.4 -classpath src/JRI.jar -d examples examples/rtest2.java

warning: [options] bootstrap class path not set in conjunction with -
source 1.4

Note: examples/rtest2.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

1 warning
make[1]: Leaving directory
'/tmp/RtmpDMwK9H/R.INSTALL4a885e7a4476/rJava/jri'

installing via 'install.libs.R' to /home/shahan/R/x86_64-pc-linux-gnu-
library/3.3/rJava

** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (rJava)

The downloaded source packages are in
‘/tmp/RtmpPksP2c/downloaded_packages’ "
install.packages("RWeka")
Error in download.file(url, destfile, method, mode = "wb", ...) : 
cannot download all files
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
downloaded length 0 != reported length 415763
Warning in download.packages(pkgs, destdir = tmpd, available =
available, :
download of package ‘RWeka’ failed
* installing *source* package ‘RWekajars’ ...
** package ‘RWekajars’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
No man pages found in package ‘RWekajars’
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (RWekajars)

The downloaded source packages are in
‘/tmp/RtmpPksP2c/downloaded_packages’ "

终于在我跑的时候

library("RWeka")

我收到以下错误。任何帮助将不胜感激。

"Error: package or namespace load failed for ‘RWeka’
Traceback:

1. library("RWeka")
2. stop(gettextf("package or namespace load failed for %s",
sQuote(package)),
. call. = FALSE, domain = NA)"

最佳答案

您可以按照以下说明操作:

$ cd ~/

$ sudo -i

$ apt-get install r-cran-rjava

$ apt-get update

$ apt-get install openjdk-8-jdk

(版本 8 似乎没有错误!)

$ rm -rf /usr/lib/jvm/default-java

(我个人没有 default-java 文件,但你可以检查它是否存在于你的机器上)

$ ln -s /usr/lib/jvm/java-8-openjdk-amd64/ /usr/lib/jvm/default-java

$ R CMD javareconf

$ R

$ install.packages(“RWeka”)

关于r - 安装 RWeka 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43406409/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com