【问题标题】:scikit-learn fails to loadscikit-learn 无法加载
【发布时间】:2013-01-29 10:46:10
【问题描述】:

我使用pip install scikit-learn 安装了 scikit-learn 0.13。

from sklearn import svm, metrics

失败

from .classes import SVC, NuSVC, SVR, NuSVR, OneClassSVM, LinearSVC
from ..linear_model.base import LinearClassifierMixin
from .base import LinearRegression
from .cd_fast import sparse_std
ImportError: sklearn/linear_model/cd_fast.so: undefined symbol: ATL_dcopy

NumPy 和 SciPy 在 1.7.0 和 0.11.0 版本中似乎没有问题(test() 通过),从源代码安装。机器上安装了最新的 ATLAS 3.10.1,同样来自源代码。

$ uname -a
Linux hostname 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux

$ python --version
Python 2.6.6

【问题讨论】:

  • numpy.distutils.system_info.get_info('blas_opt', 0) 返回什么?

标签: python linux scipy scikit-learn atlas


【解决方案1】:

添加atlas lib进行编译可以解决问题。 通过在 cblas_libs.append('m') 之前或之后添加一行来编辑文件 sklearn/linear_model/setup.py: cblas_libs.append('atlas')

然后重建并安装 scikit-learn

【讨论】:

    猜你喜欢
    • 2018-05-15
    • 1970-01-01
    • 2012-07-12
    • 2022-01-17
    • 2015-12-09
    • 2017-03-05
    • 2020-09-11
    • 2013-04-22
    • 2020-01-24
    相关资源
    最近更新 更多