Python: unresolved import error for sqlite3 in PyDev in Eclipse

import sqlite3 generates:

Unused import: sqlite3
Unresolved import: sqlite3
sqlite3 Found at: DatabaseTests

import sqlite3

However, this works fine in the terminal when using the python command line.

I am running on Mac Mountain Lion with the default Python installation. I am using PyDev in Eclipse Indigo.

+3
source share
5 answers

I have the same development environment as the same problem. I allowed him

  • transition to MacPorts the Python ,
  • using only packages that I install from this project
  • and setting the default Python interpreter on Eclipse-Pydev as MacPorts executable

, Unresolved import, , script .

+1

, , , , - :

"sqlite3" ( ) " " "" > "" > PyDev > Python Interpreter

+6

, _sqlite3 ( ) Window > Preferences > PyDev > > Python Interpreter.

+2

, -. sqlite3 (/usr/lib/python2.7/sqlite3/ , python) Project → Properties → Pydev-PYTHOPATH → .

0

(simplejson matplotlib). Ubuntu, Ubuntu 11.10 12.04 ( python eclipse).

:

  • "import sys", "print sys.executable". .
  • Eclipse - Window- > preferences- > PyDev- > interpreter-python. , 1.
  • In a problematic project, go to Project-> properties-> PyDev-PYHTONPATH, remove the old paths from the external libraries tab and add the correct ones (on Ubuntu you can find it through the synaptic manager, for example, to easily enter the synaptic manager, enter simplejson in the search field, mark right-click the result with the right mouse button and select properties from the menu, then select the "Installed files" tab to see the path to the installed files.

I hope someone finds this helpful.

0
source

All Articles