今天安装cesi时一直出现 No module named '_sqlite3'
的报错,解决方法如下:
#安装sqlite3依赖
sudo yum -y install sqlite-devel
# 重新编译安装Python 需要新增预编译配置项为`--enable-loadable-sqlite-extensions`
tar zxvf Python-3.6.8.tgz
cd Python-3.6.8
./configure --prefix=/usr/local/Python3.6/ --enable-optimizations --enable-loadable-sqlite-extensions
make -j `grep processor /proc/cpuinfo | wc -l`
rm -rf /usr/local/Python3.6/ # 我以前安装的python 删除
make install
测试:
$ python3.6
Python 3.6.8 (default, May 24 2019, 14:45:24)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>>
>>>
最后:cesi 项目成功运行。
错误参考连接:https://stackoverflow.com/questions/1210664/no-module-named-sqlite3
网友评论