简体   繁体   English

在安装RWeka时遇到问题

[英]Having issues in installation of RWeka

I have been trying to install RWeka for R through ipython notebook, but am getting errors. 我一直试图通过ipython笔记本安装RWeka for R,但是我遇到了错误。 I have ubuntu 16.10 我有ubuntu 16.10

I have tried the following commands 我尝试了以下命令

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’ "

Finally when i run 最后,当我跑

library("RWeka")

I get the below error. 我得到以下错误。 Any help would be appreciated. 任何帮助,将不胜感激。

"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)"

You could follow this instructions: 您可以按照以下说明操作:

$ cd ~/

$ sudo -i

$ apt-get install r-cran-rjava

$ apt-get update

$ apt-get install openjdk-8-jdk

(version 8 seems to be bug free!) (版本8似乎没有bug!)

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

(I personally did not have the default-java file, but you can check if it exists on your machine) (我个人没有default-java文件,但你可以检查你的机器上是否存在)

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

$ R CMD javareconf

$ R

$ install.packages(“RWeka”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM