My Linux machine has sqlite3 installed:
[root@airflow-xxxxx bin]# which sqlite3
/bin/sqlite3
[root@airflow-xxxxx bin]#
However there are two versions of Python on my machine; 3.6.8 and 3.9.10:
[root@airflow-xxxxx bin]# python3
Python 3.6.8 (default, Aug 13 2020, 07:46:32)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> exit()
[root@airflow-xxxxx bin]# python
Python 3.9.10 (main, Nov 21 2022, 14:02:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/sqlite3/__init__.py", line 57, in <module>
from sqlite3.dbapi2 import *
File "/usr/local/lib/python3.9/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
>>>
But only the 3.6 version recognizes installed sqlite3. I tried installing sqlite-devel but got "module not found" from Nexus. As I understand, SQLite comes bundled with Python. How do I get Python 3.9 to recognize the SQLite installed?