在Mac上安装WEKA for python

时间:2014-01-13 23:36:31

标签: python macos weka

我一直在尝试在我的macbook上安装WEKA for python并且遇到了一些麻烦。

首先,我通过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),如果重要的话

1 个答案:

答案 0 :(得分:2)

借用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