【发布时间】: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
【问题讨论】:
-
已解决:在此处关注我的答案-stackoverflow.com/questions/12877167/…