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

Quantstats运行报错:ModuleNotFoundError: No module named 'scipy.stats._boost.nct_ufunc'

解决Quantstats运行时的scipy.stats._boost.nct_ufunc模块缺失问题

问题重现

运行以下Quantstats代码时触发错误:

import quantstats as qs

stock = qs.utils.download_returns('FB')
print(stock)

报错信息

ModuleNotFoundError: No module named 'scipy.stats._boost.nct_ufunc'

解决方案

  • 完全卸载并重装scipy,避免缓存文件损坏:
    pip uninstall -y scipy
    pip install scipy --no-cache-dir
    
  • 指定安装兼容的scipy版本(推荐1.10.x系列,该版本boost组件结构稳定):
    pip install scipy==1.10.1
    
  • 验证IDE使用的Python环境一致性:
    • 在终端执行which python(Linux/macOS)或where python(Windows),查看当前Python路径
    • 在VSCode/PyCharm中重新指定解释器,确保依赖安装在当前使用的环境内
  • 升级pip和setuptools后重装scipy:
    pip install --upgrade pip setuptools
    pip install scipy --no-cache-dir
    

内容的提问来源于stack exchange,提问作者Rubén Dario

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.24 23:37:03