如何在Windows 7下为Python安装libsvm? [英] How do I install libsvm for python under windows 7?

查看:87
本文介绍了如何在Windows 7下为Python安装libsvm?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想知道如何在Windows 7下为Python安装libsvm吗?

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

我下载了livsvm zip,但不理解其中的说明.我已经将libsvm.dll放在我的c:\ windows \ system32目录中,但是当我尝试

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

from svm import *

我知道

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

推荐答案

我认为除非您使用的是Windows的旧版本(XP和更早版本),否则无需将dll放在C:\ windows \ system32目录中.

I think there's no need to place the dll in the C:\windows\system32 directory unless you're using old versions of Windows (XP and older).

请确保:

  • 您启动libsvm \ python目录中包含from svmutil import *的python测试脚本
  • 您仍然在libsvm \ windows目录中有一个libsvm dll的副本(如果您将其移动到C:\ windows \ system32,请将其放回libsvm \ windows目录中)
  • You launch your python test script containing from svmutil import * inside the libsvm\python directory
  • You still have a copy of the libsvm dll in the libsvm\windows directory (if you moved it to C:\windows\system32, put a copy back in the libsvm\windows directory)

这可以在我的计算机上使用.

This works on my computer.

这篇关于如何在Windows 7下为Python安装libsvm?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆