2

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?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
parthiban
  • 133
  • 1
  • 16

1 Answers1

2

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

check this link for details Python: Unresolved import error for sqlite3 in PyDev in Eclipse

Community
  • 1
  • 1
  • I suggest you to improve your example by reading the [Minimal, Complete and verifiable example](http://stackoverflow.com/help/mcve). – IlGala Dec 16 '15 at 11:19