gpt4 book ai didi

python - 在 Mac 上安装适用于 python 的 WEKA

转载 作者:行者123 更新时间:2023-12-01 05:27:07 29 4
gpt4 key购买 nike

我一直在尝试在我的 MacBook 上安装适用于 Python 的 WEKA,但遇到了一些麻烦。

首先,我通过macports安装了WEKA:

sudo port install weka

一切顺利。
然后,按照the PyPI page ,我尝试了这个命令:

sudo pip install -U https://github.com/chrisspen/weka/tarball/master

但是,这给了我以下错误:

AssertionError: Weka JAR file /usr/share/java/weka.jar not found. Ensure the file is installed or update your environment's WEKA_JAR_PATH to only include valid locations.

为了解决这个问题,我从 the University of Waikato page 下载了 WEKA ,并复制 weka.jar 如下:

sudo cp /Volumes/weka-3-6-10/weka-3-6-10/weka.jar /usr/share/java/

然后,再次运行 pip install 命令,出现以下错误:

AssertionError: Weka JAR file /usr/share/java/libsvm.jar not found. Ensure the file is installed or update your environment's WEKA_JAR_PATH to only include valid locations.

我应该如何修复这个错误?

如果重要的话,我使用的是 Mac OSX 10.9.1 (Mavericks)

最佳答案

借鉴 this other SO post 的一些智慧,我从 here 下载了 libsvm.zip 。然后,我解压缩存档并复制到 libsvm.jar,如下所示:

sudo cp libsvm-3.17/java/libsvm.jar /usr/share/java/

这似乎解决了问题,因为 pip 命令此后立即起作用:

sudo pip install -U https://github.com/chrisspen/weka/tarball/master

关于python - 在 Mac 上安装适用于 python 的 WEKA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21103503/

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