我在使用 django 时遇到以下错误:
Exception Type: ImportError
Exception Value: No module named sparse
导入错误来自:
from sklearn.svm.sparse import LinearSVC
from nltk.classify.scikitlearn import SklearnClassifier
为了解决这个问题,我尝试通过以下方式安装 scikit-learn 的稀疏模块:
sudo easy_install scikits.sparse
但我收到此错误:
no previously-included directories found matching 'doc/_build'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
clang: error: no such file or directory: 'scikits/sparse/cholmod.c'
clang: error: no input files
error: Setup script exited with error: command 'clang' failed with exit status 1
如何解决这个问题?
谢谢。
最佳答案
改变
from sklearn.svm.sparse import LinearSVC
至
from sklearn.svm import LinearSVC
忘记scikits.sparse
,它与 scikit-learn 无关。 sklearn.svm.sparse
模块已在几个版本前从 scikit-learn 中删除。
关于python - 无法安装 scikits.sparse - Clang 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19456999/