└─$ pip install pysqlite3
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pysqlite3
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/89/07/b9eb4647864581dcfe71c9d662c4067dc24970ab63f58ac7cef13dfd42e5/pysqlite3-0.5.3.tar.gz (40 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pysqlite3
Building wheel for pysqlite3 (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pysqlite3 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/pysqlite3
copying pysqlite3/__init__.py -> build/lib.linux-x86_64-cpython-38/pysqlite3
copying pysqlite3/dbapi2.py -> build/lib.linux-x86_64-cpython-38/pysqlite3
running build_ext
Builds a C extension linking against libsqlite3 library
building 'pysqlite3._sqlite3' extension
creating build/temp.linux-x86_64-cpython-38
creating build/temp.linux-x86_64-cpython-38/src
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DMODULE_NAME=\"pysqlite3.dbapi2\" -I/usr/include -I/usr/local/include/python3.8 -c src/blob.c -o build/temp.linux-x86_64-cpython-38/src/blob.o
In file included from src/blob.c:1:
src/blob.h:4:10: fatal error: sqlite3.h: No such file or directory
4 | #include "sqlite3.h"
| ^~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pysqlite3
Failed to build pysqlite3
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pysqlite3)
报错如上,手动安装依赖,之后再安装sqlite3库
sudo apt-get install libsqlite3-dev