0


ModuleNotFoundError: No module named ‘_sqlite3‘解决方法

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/

验证能否导入该模块:

成功解决:

标签: python django sqlite

本文转载自: https://blog.csdn.net/m0_53277621/article/details/128100157
版权归原作者 JohnnyassSilverhand 所有, 如有侵权,请联系我们删除。

“ModuleNotFoundError: No module named ‘_sqlite3‘解决方法”的评论:

还没有评论