Can't run wrapper from Spyder

415 views
Skip to first unread message

rg

unread,
Oct 7, 2014, 5:14:24 PM10/7/14
to python-we...@googlegroups.com
Hi I have added the paths for the wrapper and javabridge in the PYTHONPATH for Spyder. But I still get this error:


>import weka.core.jvm as jvm


Traceback (most recent call last):

  File "<ipython-input-1-3ffc2a186fc1>", line 1, in <module>
    import weka.core.jvm as jvm

ImportError: No module named weka.core.jvm

Could you please help me out.



Peter Reutemann

unread,
Oct 7, 2014, 6:47:32 PM10/7/14
to python-weka-wrapper
Did you install python-weka-wrapper using pip?

If not and you're just using the source downloaded from pypi or
github, then you don't need to add the javabridge and
python-weka-wrapper paths to the PYTHONPATH manager. Instead, just set
the working directory to the python-weka-wrapper's "python" directory
(see attached screenshot).

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

rg

unread,
Oct 8, 2014, 11:17:44 AM10/8/14
to python-we...@googlegroups.com, frac...@waikato.ac.nz
Hi Thats right I am in fact  using the source downloaded from pypi or github. But now when I do the steps you suggested I get this error:

import weka.core.jvm as jvm
Traceback (most recent call last):

  File "<ipython-input-3-3ffc2a186fc1>", line 1, in <module>
    import weka.core.jvm as jvm

  File "weka\core\jvm.py", line 17, in <module>
    import javabridge

ImportError: No module named javabridge


Thanks a lot for the help. 
 

Best 

rg

Peter Reutemann

unread,
Oct 8, 2014, 1:56:35 PM10/8/14
to python-weka-wrapper


> Hi Thats right I am in fact  using the source downloaded from pypi or github. But now when I do the steps you suggested I get this error:
>
> import weka.core.jvm as jvm
> Traceback (most recent call last):
>
>   File "<ipython-input-3-3ffc2a186fc1>", line 1, in <module>
>     import weka.core.jvm as jvm
>
>   File "weka\core\jvm.py", line 17, in <module>
>     import javabridge
>
> ImportError: No module named javabridge

Javabridge is not a pure Python package, you need to install it via pip:

pip install javabridge

Cheers, Peter

sethuraman j

unread,
Jun 21, 2016, 4:24:26 AM6/21/16
to python-weka-wrapper, frac...@waikato.ac.nz

Hello,

I am using Spyder IDE in Windows with Anaconda2 python. I have installed the python-weka-wrapper and I am getting the same error. 
I have set the PYTHONHOME/PYTHONPATH in the environment variables. It is not helping. Please checkout the screenshot attached for the error. 
I do not how to install javabridge from pip.. I am using win 7. 

Please help. 


Thank you. 

Peter Reutemann

unread,
Jun 21, 2016, 5:39:04 AM6/21/16
to python-weka-wrapper
> I am using Spyder IDE in Windows with Anaconda2 python. I have installed the python-weka-wrapper and I am getting the same error.
> I have set the PYTHONHOME/PYTHONPATH in the environment variables. It is not helping. Please checkout the screenshot attached for the error.
> I do not how to install javabridge from pip.. I am using win 7.

Install one of the pre-compiled modules of javabridge:
http://pythonhosted.org/python-weka-wrapper/install.html#windows

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/
Reply all
Reply to author
Forward
0 new messages