On 1/17/07, Kent Johnson <[EMAIL PROTECTED]> wrote:

Thomas Coopman wrote:
> Well I don't really
> need the circular imports but I would like to know how to do the imports
correct.
>
> Suppose that in the example that I showed only One needs Two.
>
> So then we have this:
>
> M/
> __init__.py
> A/
> __init__.py
> One.py
> B/
> __init__.py
> Two.py
>
> One.py
> #!/usr/bin/python
>
> from M.B import Two
>
>
> when I run this I get this error:
> ImportError: No Module named M.B

Is the directory containing M in sys.path?

Kent


When I run One.py from in the directory A, doesn't look python in it's
parent directory when it can't find the module?
And if that's not the case where and what should I add to the sys.pathvariable?


--
Thomas Coopman
[EMAIL PROTECTED]
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to