Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pydev say, "Unresolved import" error

Tags:

pydev

hm.. Sometime, PyDev say "Unresolved import error". In my environment

Python2.6.6 Eclipse3.7 PyDev2.2.2

Errors are.

> Unresolved import: pycassa  -> import pycassa Unresolved import:
> WebSocketHandler  -> from geventwebsocket.handler import
> WebSocketHandler Unresolved import: tweepy  -> import tweepy

Is there any helpfull information?

like image 246
Nariya Takemura Avatar asked Sep 02 '11 10:09

Nariya Takemura


People also ask

How do I fix unresolved imports?

To solve unresolved import error in Python, set your Python path in your workspace settings. If you are working with Visual Studio Code and import any library, you will face this error: “unresolved import”. Then reload the VSCode, and it will fix that error.

What does unresolved import mean?

An import and export each consist of a procedure or data type and a name. An unresolved import is one whose type and name do not yet match the type and name of an export.

How do I fix the import error in VSCode?

Press Ctrl + Shift + P keyboard combination, then select Python: Select Interpreter, choose the proper one with the packages you need installed, and the problem will be fixed.


3 Answers

Had the same problem. In the end I was able to fix the problem by deleting my old interpreter in Preferences > PyDev > Interpreters, and creating a new interpreter called "python" which had the correct paths. After quitting and reopening eclipse, pydev found all my modules.

like image 108
nicodjimenez Avatar answered Oct 22 '22 03:10

nicodjimenez


Probably your PYTHONPATH is not set properly (or if those are libraries in the interpreter, maybe you added them after configuring it).

See: http://pydev.org/manual_101_interpreter.html for references (note the part on forced builtins there as it might be your case).

like image 4
Fabio Zadrozny Avatar answered Oct 22 '22 04:10

Fabio Zadrozny


You get an unresolved import if the required module cannot be found. Modules are searched for in the current working directory and the directories listed in sys.path. Your python cannot find the modules pycassa and tweepy it appears.

Might want to check this: http://klaith.wordpress.com/2009/06/12/pydev-unresolved-import-errors/

like image 2
Feanor Avatar answered Oct 22 '22 04:10

Feanor