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

树莓派Debian10安装firebase_admin报egg_info错误码1如何解决

问题根因

Debian 10(Buster)预装Python版本为3.7,2023年下半年发布的firebase-admin 6.x及以上版本已完全放弃Python 3.7支持;同时提前安装的firebase包是社区维护的老旧第三方包,和Google官方的firebase-admin无任何关联,会引入版本冲突的依赖,两个问题共同触发"python setup.py egg_info" failed with error code 1报错,该问题与pip/setuptools版本、sudo执行权限无直接关系。

验证可行的修复步骤
  • 先清理环境内的冲突包残留,避免旧依赖干扰安装:
    普通用户环境执行:
    python3 -m pip uninstall -y firebase firebase-admin google-cloud-storage
    如果之前用sudo权限安装过包,额外执行:
    sudo python3 -m pip uninstall -y firebase firebase-admin google-cloud-storage
  • 安装arm架构下编译Python依赖所需的系统组件:
    sudo apt update && sudo apt install -y python3-dev libffi-dev libssl-dev build-essential
  • 安装适配Python 3.7 + Debian 10的最后一个firebase-admin稳定版,该版本官方提供了树莓派arm架构的预编译wheel包,不会触发源码编译报错:
    python3 -m pip install firebase-admin==5.4.0
  • 执行以下命令验证安装,正常输出版本号即安装成功:
    python3 -c "import firebase_admin; print(firebase_admin.__version__)"
避坑提示
  • 不要提前安装pypi上名为firebase的包,该包已停止维护超过6年,和Google官方Firebase Admin SDK无关联,安装后只会制造依赖冲突。常规Firebase服务端管理、设备端调用需求,firebase-admin本身即可覆盖。
  • Debian 10软件源没有官方支持的Python 3.8及以上版本,不要强行编译安装高版本Python后再装最新版firebase-admin,会引发更多系统级依赖冲突。如果需要使用最新版firebase-admin,直接将系统升级到Debian 11(Bullseye)及以上版本即可直接安装,不需要额外指定版本。
  • 升级pip、setuptools、wheel的操作对该问题无效,报错核心原因是版本兼容门槛不满足,不是打包工具版本过低。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.27 01:36:15