new python-weka-wrapper3 and sklearn-weka-plugin releases

94 views
Skip to first unread message

Peter Reutemann

unread,
Dec 16, 2021, 11:08:07 PM12/16/21
to python-weka-wrapper
Hi everyone

I just pushed out a new release of python-weka-wrapper3: 0.2.5
  • switched to python-javabridge, the new name (fork?) of the javabridge library
  • Package.__str__ (weka.core.packages module) method now returns a string rather than printing the name/version
  • added to_numpy(...) methods to Instance and Instances classes (module weka.core.dataset) to make it easy to obtain a numpy array from the Weka dataset
This release also forms the basis for the sklearn-weka-plugin 0.0.4 release:
  • fixed sorting of labels in to_instances method in module sklweka.dataset
  • redoing X when no class present in load_arff method (module sklweka.dataset)
  • added load_dataset method in module sklweka.dataset that uses Weka to load the data before converting it into sklearn data structures (slower, but more flexible)
Have a great Xmas break and stay safe!

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

Nour Chetouane

unread,
Dec 17, 2021, 6:43:42 AM12/17/21
to python-we...@googlegroups.com
Thank you Peter !
 Merry Christmas and Happy new year 

--
You received this message because you are subscribed to the Google Groups "python-weka-wrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-weka-wra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-weka-wrapper/CAHoQ12L5-K0yVYiaJN96bLqJnc3qV7%2BY79FvyTKZjhSxxMW1JA%40mail.gmail.com.

Nour Chetouane

unread,
Dec 17, 2021, 7:12:14 AM12/17/21
to python-we...@googlegroups.com
Hello, 

I tried to reinstall the new python-weka-wrapper3: 0.2.5 but i get an error because pip could not install python-javabridge 

Collecting python-javabridge>=4.0.0
  Using cached python-javabridge-4.0.3.tar.gz (1.3 MB)
Requirement already satisfied: numpy in /opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages (from python-weka-wrapper3) (1.21.4)
Requirement already satisfied: packaging in /opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages (from python-weka-wrapper3) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages (from packaging->python-weka-wrapper3) (2.4.7)
Building wheels for collected packages: python-javabridge
  Building wheel for python-javabridge (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/anaconda3/envs/OSi_Env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/setup.py'"'"'; __file__='"'"'/private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-wheel-jdqn_vme
       cwd: /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/
  Complete output (34 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.7
  creating build/lib.macosx-10.9-x86_64-3.7/javabridge
  copying javabridge/jutil.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
  copying javabridge/locate.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
  copying javabridge/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
  copying javabridge/wrappers.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
  copying javabridge/noseplugin.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
  creating build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
  copying javabridge/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
  copying javabridge/tests/test_cpython.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
  copying javabridge/tests/test_javabridge.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
  copying javabridge/tests/test_jutil.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
  copying javabridge/tests/test_wrappers.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
  creating build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
  copying javabridge/jars/rhino-1.7R4.jar -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
  copying javabridge/jars/runnablequeue.jar -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
  copying javabridge/jars/cpython.jar -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
  copying javabridge/jars/test.jar -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
  copying javabridge/jars/libjava2cpython.jnilib -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
  running build_ext
  javac -source 8 -target 8 /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/runnablequeue/RunnableQueue.java
  javac -source 8 -target 8 /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/javabridge/test/RealRect.java
  javac -source 8 -target 8 /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/javabridge/CPython.java /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/javabridge/CPythonInvocationHandler.java
  Note: /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/javabridge/CPythonInvocationHandler.java uses unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.
  building 'javabridge._javabridge' extension
  creating build/temp.macosx-10.9-x86_64-3.7
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/envs/OSi_Env/include -arch x86_64 -I/opt/anaconda3/envs/OSi_Env/include -arch x86_64 -I/opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages/numpy/core/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/include/darwin -I/opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages/numpy/core/include -I/opt/anaconda3/envs/OSi_Env/include/python3.7m -c _javabridge.c -o build/temp.macosx-10.9-x86_64-3.7/_javabridge.o
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for python-javabridge
  Running setup.py clean for python-javabridge
Failed to build python-javabridge
Installing collected packages: python-javabridge, python-weka-wrapper3
    Running setup.py install for python-javabridge ... error
    ERROR: Command errored out with exit status 1:
     command: /opt/anaconda3/envs/OSi_Env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/setup.py'"'"'; __file__='"'"'/private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-record-q7qpy41f/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/envs/OSi_Env/include/python3.7m/python-javabridge
         cwd: /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/
    Complete output (34 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/javabridge
    copying javabridge/jutil.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
    copying javabridge/locate.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
    copying javabridge/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
    copying javabridge/wrappers.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
    copying javabridge/noseplugin.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge
    creating build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
    copying javabridge/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
    copying javabridge/tests/test_cpython.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
    copying javabridge/tests/test_javabridge.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
    copying javabridge/tests/test_jutil.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
    copying javabridge/tests/test_wrappers.py -> build/lib.macosx-10.9-x86_64-3.7/javabridge/tests
    creating build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
    copying javabridge/jars/rhino-1.7R4.jar -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
    copying javabridge/jars/runnablequeue.jar -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
    copying javabridge/jars/cpython.jar -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
    copying javabridge/jars/test.jar -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
    copying javabridge/jars/libjava2cpython.jnilib -> build/lib.macosx-10.9-x86_64-3.7/javabridge/jars
    running build_ext
    javac -source 8 -target 8 /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/runnablequeue/RunnableQueue.java
    javac -source 8 -target 8 /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/javabridge/test/RealRect.java
    javac -source 8 -target 8 /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/javabridge/CPython.java /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/javabridge/CPythonInvocationHandler.java
    Note: /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/java/org/cellprofiler/javabridge/CPythonInvocationHandler.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    building 'javabridge._javabridge' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/envs/OSi_Env/include -arch x86_64 -I/opt/anaconda3/envs/OSi_Env/include -arch x86_64 -I/opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages/numpy/core/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/include/darwin -I/opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages/numpy/core/include -I/opt/anaconda3/envs/OSi_Env/include/python3.7m -c _javabridge.c -o build/temp.macosx-10.9-x86_64-3.7/_javabridge.o
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/OSi_Env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/setup.py'"'"'; __file__='"'"'/private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-install-9ih2kjji/python-javabridge/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/p7/bl6hy2g52ps6m5fkgn9c41k80000gn/T/pip-record-q7qpy41f/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/envs/OSi_Env/include/python3.7m/python-javabridge Check the logs for full command output
.

Do you know how to fix this ? 
thanks 

Peter Reutemann

unread,
Dec 17, 2021, 4:34:09 PM12/17/21
to python-weka-wrapper
> I tried to reinstall the new python-weka-wrapper3: 0.2.5 but i get an error because pip could not install python-javabridge
>
> Collecting python-javabridge>=4.0.0
> Using cached python-javabridge-4.0.3.tar.gz (1.3 MB)

[...]

> xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
> error: command 'gcc' failed with exit status 1

I'm not a Mac user, so I just googled for the above error message
("xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun") and came across
this post:

https://www.bpetersen.dk/post/how-to-fix-mac-os-xcrun-error-invalid-active-developer-path-missing-xcrun
Reply all
Reply to author
Forward
0 new messages