问题
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