Python包安装失败求助:fbprophet安装报错问题
解决fbprophet安装时Preparing metadata失败的问题
先强制安装符合版本要求的依赖,执行以下命令:
python3 -m pip install --upgrade cython>=0.22 numpy>=1.15.4全局环境安装失败的话,加
--user参数;用虚拟环境的话先确保环境已激活。若直接安装fbprophet仍报错,试试从源码编译安装:
- 克隆fbprophet仓库:
git clone https://github.com/facebook/prophet.git cd prophet - 安装编译依赖:
- Ubuntu/Debian系统:
sudo apt-get install gcc g++ make - macOS系统:先安装Xcode命令行工具,执行
xcode-select --install - Windows系统:安装Visual Studio Build Tools,勾选"C++ build tools"组件
- Ubuntu/Debian系统:
- 执行源码安装:
python3 setup.py install
- 克隆fbprophet仓库:
有conda环境的话,直接用conda安装更省心,预编译包可避免编译问题:
conda install -c conda-forge fbprophet额外注意:
- 确认Python版本在3.7-3.10之间,fbprophet对3.11及以上版本的支持可能存在延迟
- 安装前清理pip缓存,避免旧缓存干扰:
python3 -m pip cache purge
内容的提问来源于stack exchange,提问作者Alan Berwary
相关产品推荐
相关产品推荐

