No sqlite3 module in python and in the default linux image that I installed from the official website

I recently bought a Milk-V Duo S board for a project that requires using an SQLite database. However, when I tried to import sqlite3 in Python, I encountered an import error. I also tried running the sqlite3 command in the terminal, but it said the command was not found. Since sqlite3 usually comes preinstalled with Python, I’m not sure why it’s missing on this board. How can I install and use it? It’s crucial for my project to get the sqlite3 module working in Python, so I need a solution to fix this.

1 Like

sudo apt install sqlite3,Run the command to download directly, and then import it in Python. I tried to import it here and there was no error.

I am using the default buildroot Linux firmware image for the Duo S and there is no apt package manager support init.

1 Like

First, go to https://www.sqlite.org/download.html to download the source code sqlite-autoconf-3460100.tar.gz, then unzip it and enter the sqlite-autoconf-3460100 directory, then define the environment variable where your cross-compiled toolchain is located. My is export CC=/home/milkv/Desktop/test/duo-buildroot-sdk/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-gcc
export CXX=/home/milkv/Desktop/test/duo-buildroot-sdk/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-g++
Then run ./configure --host=riscv64-unknown-linux-musl --enable-static After success, run make then you can copy the generated sqlite3 to your duo s and use it

2 Likes