jsky
jsky

Reputation: 2217

How to install libsvm for python on mac?

UPDATE:
This seems pertinent:

libsvm (which svmtrainer needs to import) doesnt support cross_validation anymore.
Though im still not sure why i cant install libsvm to the non homebrewed python.



My python installation (which is at /Library/Frameworks..) cannot seem to recognise libsvm no matter what i try.
But my brew install at usr/local/bin/brew has it installed fine. How do i get the former to see the latter version?

I am trying to get it installed so i can use it in PyBrain in PyCharm. Currently trying to test this svm code so that i can run a multi-class SVM classification. But my Python cant find it:

    raise ImportError("Cannot find LIBSVM installation. Make sure svm.py and svmc.* are in the PYTHONPATH!")
ImportError: Cannot find LIBSVM installation. Make sure svm.py and svmc.* are in the PYTHONPATH!

So I tried this but it didnt work..

If i just download the source for libsvm and then try to make i get

make -C .. lib
if [ "Darwin" = "Darwin" ]; then \
        SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.2"; \
    else \
        SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.2"; \
    fi; \
    c++ ${SHARED_LIB_FLAG} svm.o -o libsvm.so.2

I also tried installing scikit-learn but the installation failed.
I also have a package installed at collective.recipe.libsvm but im not sure how to import it.
Any ideas how to get my Python to recognise libsvm?

Upvotes: 2

Views: 2741

Answers (1)

jsky
jsky

Reputation: 2217

This was the issue:

This seems pertinent:

libsvm (which svmtrainer needs to import) doesnt support cross_validation anymore.
Though im still not sure why i cant install libsvm to the non homebrewed python.

I am able to import libsvm from svmutil in other scripts.

Upvotes: 1

Related Questions