WSL2 ubuntu18.04运行django的时候发现该module缺失
安装编译sqlite3
wget https://sqlite.org/2019/sqlite-autoconf-3290000.tar.gz tar zxvf sqlite-autoconf-3290000.tar.gz cd sqlite-autoconf-3290000 ./configure make && make install
验证安装成功
重新编译python
找到安装路径
$ python -V Python 3.10.1 $ find / -name "Python-3.10.1" /root/Python-3.10.1 /root/Python-3.10.1/build/temp.linux-x86_64-3.10/root/Python-3.10.1
进入该路径,重新编译python
$cd /root/Python-3.10.1 $./configure --prefix=/usr/local/python3.10 $ make && make install $which python //查看环境变量python路径 /usr/bin/python $rm -rf /usr/bin/python3.10 $ln -s /usr/local/python3.10/bin/python3.10 /usr/bin/
验证能否导入该模块:
成功解决:
文章来源:https://www.toymoban.com/news/detail-726724.html
文章来源地址https://www.toymoban.com/news/detail-726724.html
到了这里,关于ModuleNotFoundError: No module named ‘_sqlite3‘解决方法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!