ImportError: No module named '_sqlite3'
问题: Python 3.5.1 报错如下
Traceback (most recent call last):
File "manage.py", line 16, in <module>
app = create_app()
File "/root/vipkid/occamy/occamy/app.py", line 140, in create_app
config_profiler(app)
File "/root/vipkid/occamy/occamy/app.py", line 111, in config_profiler
flask_profiler.init_app(app)
File "/root/vipkid/occamy/venv/lib/python3.5/site-packages/flask_profiler/flask_profiler.py", line 261, in init_app
collection = storage.getCollection(CONF.get("storage", {}))
File "/root/vipkid/occamy/venv/lib/python3.5/site-packages/flask_profiler/storage/__init__.py", line 30, in getCollection
from .sqlite import Sqlite
File "/root/vipkid/occamy/venv/lib/python3.5/site-packages/flask_profiler/storage/sqlite.py", line 1, in <module>
import sqlite3
File "/usr/local/lib/python3.5/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/usr/local/lib/python3.5/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: No module named '_sqlite3'
解决办法:
1,yum install sqlite-devel
2,重新编译Python
3,问题解决。
参考
https://stackoverflow.com/questions/1210664/no-module-named-sqlite3