How do I get pylint to recognize MySQLdb members?
问题 import MySQLdb try: dbcon = MySQLdb.connect(host=host_name, user=user_name, passwd=password, db=db_name) except MySQLdb.Error: pass getting this pylint warning Module 'MySQLdb' has no 'Error' member (no-member) 回答1: The Best: Using extension-pkg-whitelist option: A comma-separated list of package or module names from where C extensions may be loaded. Extensions are loading into the active Python interpreter and may run arbitrary code --extension-pkg-whitelist=_mysql PyLint parses (by default)