简体   繁体   中英

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?

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM