gpt4 book ai didi

r - 在 R 中安装 RWeka 包时出错

转载 作者:行者123 更新时间:2023-12-02 04:35:58 28 4
gpt4 key购买 nike

我一直在尝试在我的 RStudio(版本 0.99.902)中安装 RWeka 包,但它一直出现以下错误。我的操作系统是 Mac OS Sierra 版本 10.12。

任何见解或线索将不胜感激。

> install.packages("RWeka", lib="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")

There is a binary version available but the source version is later:
binary source needs_compilation
RWeka 0.4-26 0.4-31 FALSE

installing the source package ‘RWeka’

trying URL 'https://cran.rstudio.com/src/contrib/RWeka_0.4-31.tar.gz'
Content type 'application/x-gzip' length 409473 bytes (399 KB)
==================================================
downloaded 399 KB

* installing *source* package ‘RWeka’ ...
** package ‘RWeka’ successfully unpacked and MD5 sums checked
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
** R
** inst
** preparing package for lazy loading
JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
Error : .onLoad failed in loadNamespace() for 'RWekajars', details:
call: .jinit()
error: JNI_GetCreatedJavaVMs returned -1

ERROR: lazy loading failed for package ‘RWeka’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RWeka’
Warning in install.packages :
installation of package ‘RWeka’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/p7/z0g7bxzx4sq93z0r974xyrvh0000gn/T/RtmpnB7den/downloaded_packages’

最佳答案

我使用了说明here重新配置 rJava,然后从源代码重新编译(即使 rJava 已经正确安装)。这样做之后,RWeka 安装就成功了。我在 MacOS 10.10.5 上。

sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
sudo R CMD javareconf

然后在 R 中:

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

关于r - 在 R 中安装 RWeka 包时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42758375/

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