Strange import behavior
Fredrik Lundh
fredrik at pythonware.com
Fri Sep 1 13:12:31 EDT 2006
unexpected wrote:
> I'm having problems importing a file into my python app. Everytime I
> try to define the object specified by this file, i.e,
>
> test = Test(),
>
> It raises an ImportError exception: ImportError: cannot import name
> Test.
>
> I've declared it as:
>
> from test import Test (and I've also tried from test import *)
>
> As luck would have it, if I try creating a newfile (say test2) and then
> declare the same class as:
>
> from test2 import Test()
>
> It works fine!
your code samples make very little sense, and the last one isn't even
valid Python syntax.
maybe you could post a complete self-contained example (including the
file names, and what's in what file), instead of typing from memory ?
</F>
More information about the Python-list
mailing list