Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved import: models

I'm doing my VERY first project using python/django/eclipse/pydev following this guide

http://docs.djangoproject.com/en/dev/intro/tutorial01/

My only addition is the use of Eclipse/pydev.

I'm getting many errors related to "Unresolved imports". I can remove the errors using "remove error markers" and my site runs perfect (I can browse it) but I want to get rid definitively of this problem since errors pop up again after I removed them.

Any ideas?

EDIT

Using Ubuntu 9.1

like image 870
StackOverflower Avatar asked Jun 06 '10 04:06

StackOverflower


People also ask

What is an unresolved import?

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. A resolved import is one whose type and name exactly match the type and name of an export.

How do I resolve Python import errors?

Python's ImportError ( ModuleNotFoundError ) indicates that you tried to import a module that Python doesn't find. It can usually be eliminated by adding a file named __init__.py to the directory and then adding this directory to $PYTHONPATH .


1 Answers

Check your pythonpath. You need to include the parent directory of django, usually Lib/site-packages.

like image 74
Adam Avatar answered Oct 01 '22 12:10

Adam