解决树莓派找不到sqlite3 的问题


  • 问题描述

WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?

WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?

WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?

树莓派已经安装了sqlite3 ,但是用pyenv 安装完3.8.3 的python提示没有安装sqlite3 扩展,后续使用也会报模块找不到

尝试重装python 3.8.3 版本依然无法找到sqlite3

  • 下载sqlite
    https://www.sqlite.org/2020/sqlite-autoconf-3320300.tar.gz
    tar zxf sqlite-autoconf-3320300.tar.gz
    cd sqlite-autoconf-3320300
    ./configure --prefix=/usr/local
    make
    make install
    
  • 重装python 3.8.3
    pyenv uninstall 3.8.3
    pyenv install 3.8.3
    
  • 最终排查是树莓派pyenv的环境问题

https://www.jianshu.com/p/43146dc0a07b

一定要安装软件依赖

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm