Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install libsvm for python under windows 7?

Would like to know how to install libsvm for python under windows 7?

I downloaded the livsvm zip, but I don't understand the instructions included. I have placed the libsvm.dll in my c:\windows\system32 directory, but when I try

import svmutil

or

from svm import *

I get

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "svmutil.py", line 3, in <module>
    from svm import *
  File "svm.py", line 16, in <module>
    '../windows/libsvm.dll'))
  File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
like image 215
Superdooperhero Avatar asked Oct 13 '12 21:10

Superdooperhero


1 Answers

SOLVED:
1. Navigate to http://www.lfd.uci.edu/~gohlke/pythonlibs/#libsvm
2. Download the .whl file of libsvm corresponding to your OS.
3. Open command prompt and navigate to that folder containing the downloaded .whl file.
4. Type the following command in command prompt-

pip install libsvm-3.20-cp27-none-win32.whl

NOTE: Type name of your .whl file after pip install

like image 74
Vinod Kumar Chauhan Avatar answered Oct 14 '22 13:10

Vinod Kumar Chauhan