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

导入lmoments3遇scipy.stats无frechet_r_gen属性错误求助

解决 module 'scipy.stats._continuous_distns' has no attribute 'frechet_r_gen' 错误
  • 先检查当前conda环境的scipy版本,执行命令:
    conda list scipy
  • 若scipy版本过低,用conda升级(避免pip与conda的依赖冲突):
    conda update scipy
  • 升级后仍报错的话,是因为scipy中frechet_r_gen已被weibull_min_gen替代,需修改lmoments3的distr模块:
    找到conda环境中lmoments3的distr.py文件(路径示例:~/anaconda3/envs/你的环境名/lib/pythonX.X/site-packages/lmoments3/distr.py),把所有引用scipy.stats._continuous_distns.frechet_r_gen的代码替换为scipy.stats._continuous_distns.weibull_min_gen
  • 也可以安装适配性更好的lmoments3旧版本:
    pip uninstall lmoments3
    pip install lmoments3==1.0.2
  • 优先用conda安装包来适配当前环境:
    conda install -c conda-forge lmoments3

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.21 05:48:19