Error: Module 'sqlite3' has no connect member

一曲冷凌霜 提交于 2020-12-06 15:10:27

问题


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')

回答1:


You can safely ignore these PyLint warnings.

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

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.

It should, however, run just fine.



来源:https://stackoverflow.com/questions/56844593/error-module-sqlite3-has-no-connect-member

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!