Eclipse-pydev, while trying to import sqlite3 im getting “Undefined variable from import: connect”
问题 Eclipse version : Version: 3.8.1 import sqlite3 sqlite3.connect('database.db') print "Database connected successfully" in the above code, sqlite3.connect() is displayed as Undefined variable from import: connect But when i run the code it is running properly, why is that it is displayed as Error in eclipse-pydev? 回答1: I also faced the similar issue, solution is --> You need to add 'sqlite3' (without the quotatios) in the 'forced builtins' tab in Window>Preferences>PyDev>Python Interpreter