The following forum message was posted by seaders at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4366170:
Ok, so if I create a brand new virtualenv, then hop into that environment, go
into a python shell within that environment, and run 'import logging', for instance,
it imports absolutely fine. I can then start up eclipse, create a new interpreter
based on the /bin/python in my virtualenv and if I open up a python console
within eclipse, based on this new interpreter, I can run 'import logging' again
without any problems. I can create a project, with this new interpreter and
create a sample file with nothing but
[code]
import logging
print asdf
[/code]
I'll get an 'unresolved import' error with the line 'import logging'. This
can be resolved by adding in the system lib/pythonX.X directory (in my case
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6) to the
interpreter configuration, but I'd be under the impression that this is
counter-intuitive for what you'd want to be doing with eclipse and virtualenv.
I know the stuff that's in that lib/pythonX.X directory are pretty much nothing
but the base classes, but if they should always be included, should they not
just be included anyway? Is this not against the way virtualenv setting up
links to these very classes within it's own lib/pythonX.X directory? Is adding
the base python lib/pythonX.X directory to the eclipse interpreter the correct
way to do this, or is there problems with doing this?
Am I getting confused by the whole setup, or is it actually confusing and I'm
right to ask the question? Thanks for anyone who can help.
|