Unable to import sqlite3 using Anaconda Python

G L picture G L · Feb 26, 2019 · Viewed 23.5k times · Source

I am trying to do the following in Python 3.7.1 on Windows

import sqlite3

but I get the following error message

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "c:\programdata\anaconda3\lib\sqlite3\__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "c:\programdata\anaconda3\lib\sqlite3\dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.

I have searched for a solution to the problem for quite a while now to no avail. I have also successfully run pip install pysqlite3 on the Anaconda prompt, but the import still fails. What do?

Answer

elgsantos picture elgsantos · Apr 12, 2019

I got this working on windows by downloading: the sqlite3 dll (find your system version)

And putting into the folder: C:\Users\YOURUSER\Anaconda3\DLLs

(Depending on how you installed Anaconda, this may have to be placed into the following folder: C:\ProgramData\Anaconda3\DLLs)