python - 无法安装 scikits.sparse - Clang 错误

标签 python scikit-learn installation clang sparse-matrix

我在使用 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/

相关文章:

具有递归的 Python C API - 段错误

python - 如何将字符串中的小写字符和大写字符分开?

python - 无限滚动抓取网站

python - 对所选列进行分组和标准化 Pandas DF

python - Scikit-Learn/Pandas : make a prediction using a saved model based on user input

installation - 在使用Inno Setup进行安装之前如何运行文件

windows - 使用 Windows Active Setup 的优缺点

gem - 错误无法在本地 Windows 7 Ruby on Rails 上加载 'pg' gem

python - 在Python中,是否可以在另一个请求中模拟请求?

python - 决策树生成具有相同类的终端叶