错误:模块“sqlite3"没有连接成员 [英] Error: Module 'sqlite3' has no connect member

查看:57
本文介绍了错误:模块“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.

不过,它应该运行就好了.

这篇关于错误:模块“sqlite3"没有连接成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆