0

I tried to install libsvm downloaded from here http://www.csie.ntu.edu.tw/~cjlin/libsvm/ I already do the stepped written in the README which is

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

I also copied the libsvm.dll to my windows32 folder.

I cant seem to find anything wrong but when I compiled a python code with "import svm" in it, I got the following error:

$ 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
fuschia
  • 283
  • 2
  • 6
  • 23
  • Solved:Follow my answer at here- http://stackoverflow.com/questions/12877167/how-do-i-install-libsvm-for-python-under-windows-7/32358275#32358275 – Vinod Kumar Chauhan Sep 02 '15 at 16:28

1 Answers1

1

Easy way to install:

Download libsvm's install binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/#libsvm You might want to install libsvm‑3.17.win‑amd64‑py2.7.exe or libsvm‑3.17.win32‑py2.7.exe depending upon you windows config

Ashoka Lella
  • 6,631
  • 1
  • 30
  • 39