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

树莓派5 64位系统安装python3-tflite-runtime依赖错误求助

树莓派5 64位RPI OS安装python3-tflite-runtime依赖冲突解决办法

问题根源

官方apt仓库提供的python3-tflite-runtime包仅支持Python 3.10及更低版本,但你的树莓派5搭载的64位RPI OS默认使用Python 3.11.2,直接通过apt安装会触发依赖不兼容错误。

解决方案

方案1:使用pip安装预编译包(推荐)

这是最快捷的方式,直接安装适配Python 3.11的ARM64版本:

  1. 更新pip到最新版本:
    sudo apt update && sudo apt install python3-pip -y
    python3 -m pip install --upgrade pip
    
  2. 安装对应版本的tflite-runtime:
    python3 -m pip install tflite-runtime==2.15.0 --extra-index-url https://google-coral.github.io/py-repo/
    
    可按需替换版本号(如2.16.0),确认目标版本有ARM64预编译包即可。

方案2:源码编译安装

如果pip安装失败,可手动编译适配当前Python版本的包:

  1. 安装编译依赖:
    sudo apt update && sudo apt install build-essential cmake git python3-dev -y
    
  2. 克隆TensorFlow Lite源码并切换到指定版本:
    git clone https://github.com/tensorflow/tensorflow.git
    cd tensorflow
    git checkout v2.15.0
    
  3. 编译Python绑定并生成wheel包:
    ./tensorflow/lite/tools/make/build_rpi_lib.sh
    cd tensorflow/lite/tools/pip_package
    python3 setup.py bdist_wheel
    
  4. 安装编译好的wheel包:
    pip install dist/tflite_runtime-*.whl
    

验证安装结果

执行以下命令确认安装成功:

python3 -c "import tflite_runtime.interpreter as tflite; print('TFLite runtime installed successfully')"

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.25 21:03:28