【问题标题】:install libsvm for python in windows在 windows 中为 python 安装 libsvm
【发布时间】:2014-04-05 14:46:17
【问题描述】:

我尝试安装从这里下载的 libsvm http://www.csie.ntu.edu.tw/~cjlin/libsvm/ 我已经完成了 README 中写的步骤,即

Building Windows Binaries
=========================

Windows binaries are in the directory `windows'. To build them via
Visual C++, use the following steps:

1. Open a DOS command box (or Visual Studio Command Prompt) and change
to libsvm directory. If environment variables of VC++ have not been
set, type

"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"

You may have to modify the above command according which version of
VC++ or where it is installed.

2. Type

nmake -f Makefile.win clean all

3. (optional) To build shared library libsvm.dll, type

nmake -f Makefile.win lib

我还将 libsvm.dll 复制到我的 windows32 文件夹中。

我似乎找不到任何错误,但是当我编译一个带有“import svm”的python代码时,我得到了以下错误:

$ python analyze.py
Traceback (most recent call last):
  File "analyze.py", line 2, in <module>
    import baseline_classifier, naive_bayes_classifier, max_entropy_classifier, libsvm_classifier
  File "D:\twitter-sentiment-analyzer-master\libsvm_classifier.py", line 1, in <module>
    import svm
ImportError: No module named svm

【问题讨论】:

标签: python svm


【解决方案1】:

安装简单:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#libsvm 下载 libsvm 的安装二进制文件 您可能需要安装 libsvm‑3.17.win‑amd64‑py2.7.exelibsvm‑3.17.win32‑py2.7.exe,具体取决于您的 Windows 配置

【讨论】:

    猜你喜欢
    • 2012-10-04
    • 2016-05-19
    • 2014-06-14
    • 2015-01-24
    • 2013-11-29
    • 2016-09-23
    • 2015-06-16
    • 1970-01-01
    • 2013-11-20
    相关资源
    最近更新 更多