问题描述
我正在尝试在 Windows 上的 Python 3.7.1 中执行以下操作
I am trying to do the following in Python 3.7.1 on Windows
import sqlite3
但我收到以下错误消息
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "c:programdataanaconda3libsqlite3\__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "c:programdataanaconda3libsqlite3dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.
我已经搜索了很长一段时间的问题的解决方案,但无济于事.我也在 Anaconda 提示符下成功运行 pip install pysqlite3
,但导入仍然失败.怎么办?
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?
推荐答案
我通过下载在 Windows 上得到了这个:sqlite3 dll(找到你的系统版本)
I got this working on windows by downloading: the sqlite3 dll (find your system version)
并放入文件夹:C:UsersYOURUSERAnaconda3DLLs
And putting into the folder: C:UsersYOURUSERAnaconda3DLLs
(根据您安装 Anaconda 的方式,这可能需要放入以下文件夹:C:ProgramDataAnaconda3DLLs)
(Depending on how you installed Anaconda, this may have to be placed intothe following folder: C:ProgramDataAnaconda3DLLs)
这篇关于无法使用 Anaconda Python 导入 sqlite3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!