0

I'm trying to run a python application, but I'm getting an error that points to sqlite3 not existing. This is odd since sqlite3 has come standard with Python since 2.5. I am running Python 2.7.11. I can list Python modules and see sqlite3 using

pydoc modules

But I get the following error:

>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 28, in <module>
    from _sqlite3 import *
ImportError: No module named _sqlite3

I tried to resolve this by installing pysqlite, as suggested by another user.

pip install pysqlite

But I encountered another error:

src/connection.h:33:21: error: sqlite3.h: No such file or directory

Which brings me back to my initial confusion.

Ryan
  • 2,058
  • 1
  • 15
  • 29
  • Your second error 'sqlite3.h' No such file or directory is because you are missing some header files. If you run ubuntu you should install package libsqlite3-dev – Akilesh Aug 16 '16 at 16:25
  • I'm on RHEL, so there is likely an equivalent. And I will check if this is a duplicate. – Ryan Aug 16 '16 at 16:29

0 Answers0