我是 Python 新手。我想在我的项目中使用 svm。我使用的是 libsvm 3.12,但是当我这样做时..
from svm import *
然后我收到以下错误:
Traceback (most recent call last): File "C:/Python27/main.py", line 31, in from svm import * File "C:/Python27\svm.py", line 12, in libsvm = CDLL(find_library('libsvm')) File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__ self._handle = _dlopen(self._name, mode) WindowsError: [Error 193] %1 is not a valid Win32 application
我应该做什么?
libsvm
README
文件建议我将 libsvm.dll
复制到 system32
文件夹中,我这样做了..但我仍然收到错误。我正在使用 64 位 Python。也许这就是导致问题的原因?
最佳答案
我也遇到了同样的问题。
正如 Velociraptors 在 VLC Python Bindings -- Error 193 中发布的那样:
I'm going to guess that the problem is trying to load a 32-bit DLL from a 64-bit process. You may be able to fix it by using a 32-bit Python build.
我们通过从 http://www.lfd.uci.edu/~gohlke/pythonlibs/#libsvm 下载 python 的 libSVM 解决了这个问题
关于python-2.7 - Python 中的 libsvm : getting error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10634569/