简体   繁体   English

如何在Mac上为Python安装libsvm?

[英]How to install libsvm for python on mac?

UPDATE : 更新
This seems pertinent: 似乎是相关的:

libsvm (which svmtrainer needs to import) doesnt support cross_validation anymore. libsvm(svmtrainer需要导入)不再支持cross_validation
Though im still not sure why i cant install libsvm to the non homebrewed python. 虽然我仍然不确定为什么我不能将libsvm安装到非自制Python。



My python installation (which is at /Library/Frameworks..) cannot seem to recognise libsvm no matter what i try. 我的python安装(位于/ Library / Frameworks ..)似乎无法识别libsvm无论我尝试什么。
But my brew install at usr/local/bin/brew has it installed fine. 但是我在usr / local / bin / brew上的brew安装程序安装得很好。 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. 我正在尝试安装它,以便可以在PyCharm的PyBrain中使用它。 Currently trying to test this svm code so that i can run a multi-class SVM classification. 目前正在尝试测试此svm代码,以便我可以运行多类SVM分类。 But my Python cant find it: 但是我的Python找不到它:

    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 如果我只是下载libsvm的源代码,然后尝试make我明白

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. 我也尝试安装scikit-learn,但安装失败。
I also have a package installed at collective.recipe.libsvm but im not sure how to import it. 我也有一个包安装在collective.recipe.libsvm,但是我不确定如何导入它。
Any ideas how to get my Python to recognise libsvm? 有什么想法如何让我的Python识别libsvm吗?

This was the issue: 这是问题所在:

This seems pertinent: 似乎是相关的:

libsvm (which svmtrainer needs to import) doesnt support cross_validation anymore. libsvm(svmtrainer需要导入)不再支持cross_validation
Though im still not sure why i cant install libsvm to the non homebrewed python. 虽然我仍然不确定为什么我不能将libsvm安装到非自制Python。

I am able to import libsvm from svmutil in other scripts. 我可以在其他脚本中从svmutil导入libsvm。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM