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

Python 3.7下无法安装及导入Prophet模块的问题求助

解决Python 3.7下Facebook Prophet安装失败及导入报错问题
  • 锁定兼容版本安装
    Facebook Prophet从v1.1版本起不再支持Python 3.7,直接安装最新版会失败。指定兼容的1.0.1版本安装:

    • pip方式:pip install prophet==1.0.1
    • conda方式:用conda-forge源安装兼容版本,执行 conda install -c conda-forge prophet==1.0.1
  • 修复VS Code导入波浪线问题
    编辑器里的波浪线通常是因为当前激活的Python解释器未安装Prophet。按Ctrl+Shift+P(Windows/Linux)或Cmd+Shift+P(Mac),输入Python: Select Interpreter,选择你安装了Prophet的Python 3.7环境即可。

  • 前置依赖补装(若安装时提示依赖错误)
    Prophet依赖特定版本的pystan,先手动安装依赖:
    pip install pandas numpy matplotlib pystan==2.19.1.1

你的导入代码本身没有问题,环境配置正确后就能正常运行:

import streamlit as st
from datetime import date

import yfinance as yf
from prophet import Prophet

内容的提问来源于stack exchange,提问作者Srijan K.

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.10 15:50:20