Python Forum
ImportError: No module named '_sqlite3'
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ImportError: No module named '_sqlite3'
#1
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/__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'


Thankew
Reply
#2
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?
Reply
#3
_sqlite3 ? With underscore at the beginning? No

https://docs.python.org/3.5/library/sqlite3.html

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

https://docs.python.org/3.5/library/sqlite3.html



That is what caught my attention too. But I did a quick search and the error message does actually return underscored _sqlite3
Reply
#5
Hm! I can't reproduce the error. I've looked at dbapi2.py and  /usr/lib/python3.5/sqlite3/__init__.py 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."
https://freedns.afraid.org
Reply
#6
It is per-installed with python 3.6.3, and I believe has been since 2.7
Reply


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

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