错误:模块“sqlite3"没有连接成员
我写了几行 Python 代码.但我不断收到以下错误:模块sqlite3"没有连接"成员 pylint(no-member)[6,8].任何可能导致这种情况的想法.
I have written a few python code lines. But I keep on getting the following error: Module 'sqlite3' has no 'connect' member pylint(no-member)[6,8]. Any ideas what might be causing this.
import sqlite3
import os
os.chdir('D:/SQL/Databases')
conn = sqlite3.connect('GVP - Eruptions Trial 1.2.db')
您可以放心地忽略这些 PyLint 警告.
You can safely ignore these PyLint warnings.
作为一项安全措施,PyLint 不会导入不受信任的 C 扩展(我们可能信任 SQLite,但 PyLint 将受信任"定义为在标准库中).请参阅此处了解详情(包括如何将您的扩展程序列入白名单(如果需要)删除警告).
As a security measure, PyLint does not import untrusted C extensions (we may trust SqLite but PyLint defines "trusted" as being in the standard library). See here for details (including how to whitelist your extensions if you want to remove the warnings).
它不导入它的原因是因为这将允许攻击者运行任意代码.如果它有一种无需导入即可创建 AST(抽象语法树)的方法(即,只需检查文件),就会安全得多.
The reason it does not import it is because that would allow an attacker to run arbitrary code. If it had a way of creating the AST (abstract syntax tree) without importing (i.e., by just examining the file), it would be a lot safer.
不过,它应该运行就好了.