Unresolved import in Eclipse

1,975 views
Skip to first unread message

cocolombo

unread,
Dec 1, 2010, 12:47:29 PM12/1/10
to Django users
Hi everyone.

I am using Eclipe 3.6.1 with Python 2.7 on Windows XP and my problem
is the following:

1) I have installed a module named : django-urlauth-0.1.1

2) In Eclipse, at the left of the line:

from urlauth.util import wrap_url

Eclipse qive a big red dot with the message : Unresolved import
wrap_url

3) But strangely If I open a shell window (django environnemnt window)
in Eclipse and type:

>> from urlauth.util import wrap_url

everything is fine and I can access the wrap_url function from the
shell window.

Any Idea what is wrong. I am new to django and Eclipse so maybe this
is trivial stuff, sorry if this is the case.

cclmb





cootetom

unread,
Dec 1, 2010, 6:51:00 PM12/1/10
to Django users
I take it you're using PyDev with eclipse? My experience is that
eclipse often says that it can't resolve an import but is wrong. Just
remember an import will work if it is on your python path. When you
run the django project from eclipse it will use the python path as
well as the project directory to resolve imports. You can tell PyDev
about paths that you're importing from so that it knows where to
check. You do this for a project by clicking Project > Properties >
PyDev - PYTHONPATH. You can then add paths to the list of source
folders. I generally don't bother and tend to ignore eclipse's warning
about unresolved imports. If the import is wrong then you'll know
about it as soon as you try and run the website as it'll complain
loudly!

Andre Terra

unread,
Dec 1, 2010, 6:54:40 PM12/1/10
to django...@googlegroups.com
You could also try using Aptana Studio, which is imho better than Eclipse for django development. They're very similar, but it's more refined.


Mind you, I've never used it as a plugin, just the standalone version.


Sincerely,

Andre Terra



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


Javier Guerra Giraldez

unread,
Dec 1, 2010, 8:22:12 PM12/1/10
to django...@googlegroups.com
On Wed, Dec 1, 2010 at 6:54 PM, Andre Terra <andre...@gmail.com> wrote:
> I've never used it as a plugin, just the standalone version.

the standalone is just an Eclipse installer with the plugin already
configured (and a few relevant others)

--
Javier

cocolombo

unread,
Dec 1, 2010, 9:43:53 PM12/1/10
to Django users
Thank you all.

Project > Properties > PyDev - PYTHONPATH was the problem I had.

I will try using Aptana Studio.

Thanks again.

On Dec 1, 8:22 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote:
Reply all
Reply to author
Forward
0 new messages