Python sqlite3.Connection object has no attribute 'enable_load_extension

July 31, 2019
pyenv compile with –enable-loadable-sqlite-extensions

I install Python 3.7.4 using pyenv, but trying to run Connection.enable_load_extension raise AttributeError: 'sqlite3.Connection' object has no attribute 'enable_load_extension'.

import sqlite3
conn = sqlite3.connect('test.db')

conn.enable_load_extension(True)

To solve this problem, need to build python with --enable-loadable-sqlite-extensions.

CONFIGURE_OPTS=--enable-loadable-sqlite-extensions pyenv install 3.7.4
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.