Installation issues

412 views
Skip to first unread message

Kam

unread,
Feb 25, 2018, 9:42:19 PM2/25/18
to python-weka-wrapper
Hello Team,

First apologies if it's a repeat post and, if the case, would be great if you can direct me to the respected link.

I must admit that I could not find much documentation related to installation. Anyway, I am trying to install the wrapper using pip but getting the following error.

(C:\ProgramData\Anaconda3) C:\WINDOWS\system32>pip install python-weka-wrapper
Collecting python-weka-wrapper
  Downloading python-weka-wrapper-0.3.12.tar.gz (92kB)
    100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 92kB 581kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\RANDU~1\AppData\Local\Temp\pip-build-vp2bx01s\python-weka-wrapper\setup.py", line 41
        except HTTPError, e:
                        ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\RANDU~1\AppData\Local\Temp\pip-build-vp2bx01s\python-weka-wrapper\

Any help is much appreciated!

Regards
Kam

Peter Reutemann

unread,
Feb 25, 2018, 9:50:50 PM2/25/18
to python-weka-wrapper
"python-weka-wrapper" is for Python 2.7, "python-weka-wrapper3" is for
Python 3. Install the latter and you shouldn't get any errors.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/

Kam

unread,
Feb 25, 2018, 9:56:28 PM2/25/18
to python-weka-wrapper
P.S. Okay sorry I got the documentation page now and figured out that I need to install javabridge before installing the Weka wrapper. However, I am now getting the following error. Do I need a jdk installed as well?
I am on a Windows 10 machine and using Python 3.6 through Anaconda 4.4.0.  

      File "C:\Users\RANDU~1\AppData\Local\Temp\pip-build-ayu2dqd_\javabridge\javabridge\locate.py", line 162, in find_jdk
        kjdk = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, jdk_key_path)
    FileNotFoundError: [WinError 2] The system cannot find the file specified

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\RANDU~1\AppData\Local\Temp\pip-build-ayu2dqd_\javabridge\setup.py", line 393, in <module>
        ext_modules=ext_modules(),
      File "C:\Users\RANDU~1\AppData\Local\Temp\pip-build-ayu2dqd_\javabridge\setup.py", line 96, in ext_modules
        jdk_home = find_jdk()
      File "C:\Users\RANDU~1\AppData\Local\Temp\pip-build-ayu2dqd_\javabridge\javabridge\locate.py", line 171, in find_jdk
        except WindowsError as e:
    UnboundLocalError: local variable 'WindowsError' referenced before assignment

Kam

unread,
Feb 25, 2018, 9:57:34 PM2/25/18
to python-weka-wrapper
Thanks for your quick response Peter, are there any other dependencies?

Regards
Kam

Kam

unread,
Feb 25, 2018, 10:00:55 PM2/25/18
to python-weka-wrapper
Wrapper 3 seemed to have worked but failed again on javabridge with the error I posted above.

Regards,
Kam

Peter Reutemann

unread,
Feb 25, 2018, 10:07:10 PM2/25/18
to python-weka-wrapper
> P.S. Okay sorry I got the documentation page now and figured out that I need
> to install javabridge before installing the Weka wrapper. However, I am now
> getting the following error. Do I need a jdk installed as well?

Yes. As it says under "Prerequisites for all plaforms":
http://fracpete.github.io/python-weka-wrapper3/install.html#prerequisites-for-all-plaforms

Here are the instructions for Windows:
http://fracpete.github.io/python-weka-wrapper3/install.html#windows

Roshani M S

unread,
Mar 9, 2018, 2:28:02 AM3/9/18
to python-weka-wrapper
Hello, 
I am able to install weka wrapper on my command prompt.

But when I try to run the following on my jupyter notebook,
import weka.core.jvm as jvm

I get the below error,

JVMNotFoundError: Can't find Java Virtual Machine


Please help me resolve it 

Peter Reutemann

unread,
Mar 9, 2018, 3:01:44 AM3/9/18
to python-we...@googlegroups.com
On March 9, 2018 8:28:02 PM GMT+13:00, Roshani M S <msro...@gmail.com> wrote:
>Hello,
>I am able to install weka wrapper on my command prompt.
>
>But when I try to run the following on my jupyter notebook,
>import weka.core.jvm as jvm
>
>I get the below error,
>
>JVMNotFoundError: Can't find Java Virtual Machine
>
>
>Please help me resolve it
I don't use Jupyter and I suspect that you can't get pww to work with it (mainly because the jvm can only be started once by a process and not restarted, limitation of the javabridge library that pww uses).

Just use pww within regular Python scripts. Eg use an IDE like PyCharm.
Reply all
Reply to author
Forward
0 new messages