Crista23
Crista23

Reputation: 3243

Use Weka in Python

I have been trying unssuccessfully so far to install the package for Weka (Weka 0.1.3)found here on my Windows computer. My problem is that each time I try to run the setup or use the command:

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

I get an assertion error saying that

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

Indeed I do not have this file, but how should I get it? I am not sure if I missed anything regarding the installation, at least I did what's specified on the official webpage.

Any suggestions? Many thanks!

Upvotes: 2

Views: 4723

Answers (2)

hkn
hkn

Reputation: 1448

To run in Windows:

  • Add weka.jar, libsvm.jar, wlsvm.jar to C:\usr\share\java directory (libsvm.jar and wlsvm.jar can be found at http://www.cs.iastate.edu/~yasser/wlsvm/)
  • run pip install -U https://github.com/chrisspen/weka/tarball/master
  • When you try to run classifiers you will get a classpath error. To solve this error edit installed file <Python install dir>\Lib\site-packages\weka\classifiers.py
  • Line 33: Change for _cp in CP.split(':'): to for _cp in CP.split(os.pathsep):
  • Line 286: Change close_fds=True to close_fds=sys.platform != "win32"

Upvotes: 1

Steve Barnes
Steve Barnes

Reputation: 28370

Since this is a wrapper package you need to install Weka, (presumably for windows), as well - it is here you may also have to upgrade or install java.

Upvotes: 1

Related Questions