Python Forum
ImportError: No module named '_sqlite3'
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ImportError: No module named '_sqlite3'
Whenever i'm importing sqlite3, it give an import error. Can anyone tell me how to import sqlite3 for python3. Apart, im using cent os 6.5 on my vps.

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/sqlite3/", line 23, in <module>
from sqlite3.dbapi2 import *
File "/usr/local/lib/python3.5/sqlite3/", line 27, in <module>
from _sqlite3 import *
ImportError: No module named '_sqlite3'

Did you check if the module is actually installed with your Python interpreter? You can do that with "pip list" command in the console.

It could also mean a version mismatch. e.g. your system has default Python 2, but you downloaded/compiled sqlite3 for Python 3.
Which Python are you using? Did you install it yourself? And how did you install sqlite3?
_sqlite3 ? With underscore at the beginning? No

@j.crater, it is a part of the standard library
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
(Dec-16-2017, 01:06 PM)wavic Wrote: _sqlite3 ? With underscore at the beginning? No

That is what caught my attention too. But I did a quick search and the error message does actually return underscored _sqlite3
Hm! I can't reproduce the error. I've looked at and  /usr/lib/python3.5/sqlite3/ and the lines pointed at the error message are there.

Did you try to reinstall Python3? OS?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
It is per-installed with python 3.6.3, and I believe has been since 2.7

Possibly Related Threads…
Thread Author Replies Views Last Post
  No module named theapp Clives 10 3,563 Jun-10-2021, 11:16 AM
Last Post: Larz60+
  ModuleNotFoundError: No module named "requests" BushFacts 1 4,478 Jan-13-2020, 06:49 AM
Last Post: perfringo
  Django getting ModuleNotFoundError: No module named '=' Malt 0 2,442 Aug-30-2019, 08:34 AM
Last Post: Malt
  No module named flask_themes voipsense 4 3,798 Feb-25-2019, 06:54 PM
Last Post: voipsense
  About .profile and ImportError: No module named RicardoAbdala 1 2,445 Aug-28-2018, 05:32 AM
Last Post: buran
  ImportError: No module named django.core.exceptions in google app engine timtinan37 4 3,900 Jun-18-2018, 01:34 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020