Nadav Kiani
Nadav Kiani

Reputation: 331

ImportError: DLL load failed: The specified module could not be found in PyCharm

I am trying to work with SQLite from PyCharm. I downloaded SQLite, extract it and put it in C:/. Then I changed the 'PATH' to C:/. Then I opened PyCharm and write this code:

import sqlite3

connection = sqlite3.connect('db/test.db')

cursor = connection.cursor()

And I have got this error:

Traceback (most recent call last):
  File "C:/Users/nadav/.PyCharmCE2019.1/config/scratches/scratch_1.py", line 1, in <module>
    import sqlite3
  File "C:\Users\nadav\Anaconda3\lib\sqlite3\__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "C:\Users\nadav\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.

What am I missing?

Upvotes: 0

Views: 1844

Answers (1)

Brad123
Brad123

Reputation: 944

I came across the same issue when I was running a code in the windows CMD prompt. The work-around i found was to run the same script in a 'Anaconda prompt' Hope this helps...

Upvotes: 1

Related Questions