Python Forum
ImportError: No module named '_sqlite3' - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: ImportError: No module named '_sqlite3' (/thread-6981.html)



ImportError: No module named '_sqlite3' - armanmax11 - Dec-16-2017

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


RE: ImportError: No module named '_sqlite3' - j.crater - Dec-16-2017

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?


RE: ImportError: No module named '_sqlite3' - wavic - Dec-16-2017

_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


RE: ImportError: No module named '_sqlite3' - j.crater - Dec-16-2017

(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


RE: ImportError: No module named '_sqlite3' - wavic - Dec-16-2017

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?


RE: ImportError: No module named '_sqlite3' - Larz60+ - Dec-16-2017

It is per-installed with python 3.6.3, and I believe has been since 2.7