You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

导入lazypredict的REGRESSORS模块时出现NoneType.split()错误如何解决?

解决lazypredict导入REGRESSORS时的AttributeError错误

这个错误源于threadpoolctl库在检测底层线性代数库(如BLAS/LAPACK)配置时返回None,导致调用split()方法失败,以下是可行的解决办法:

方案1:降级threadpoolctl版本

该问题常出现在threadpoolctl 3.2.0及以上版本与部分环境的兼容性冲突中,降级到稳定版本即可修复:

pip install threadpoolctl==3.1.0

方案2:通过环境变量跳过配置检测

在导入lazypredict前设置环境变量,让threadpoolctl跳过所有库的配置检测:

import os
os.environ['THREADPOOLCTL_NO_DETECT'] = '1'

import lazypredict
from lazypredict.Supervised import REGRESSORS

方案3:重新安装兼容的依赖包

卸载现有相关依赖后重新安装,确保所有库版本匹配:

pip uninstall -y lazypredict scikit-learn threadpoolctl
pip install lazypredict

方案4:修复conda环境的线性代数库(针对conda用户)

如果使用conda环境,可能是MKL与其他库冲突,替换为OpenBLAS:

conda install openblas

内容的提问来源于stack exchange,提问作者The Great

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 19:15:31