3
votes

Whenever I'm importing sqlite3, it gives an import error. Can anyone tell me how to import sqlite3 for python3. Apart, I'm using CentOS 6.5 on my vps.

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

1

1 Answers

0
votes

I'm using CentOS 8 and python 3.7.

I found same issue on running my jupyter notebook and solved my issue with this solution.

  1. $ sudo yum install sqlite-devel
  2. $ cd /python_path
  3. $ ./configure
  4. $ make && make install

This solution is re-compile python after install sqlite-devel.