Strange import behavior

unexpected sumesh.chopra at
Fri Sep 1 18:37:46 CEST 2006

Hey guys,

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

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! I tried doing this with the first couple of files, but
then another error crops up for another file giving me this I'd end up having to re-copy a bunch of files over

I feel like there may be some sort of dependency screw up or
whatever..Is there a command that's like "Python, chill, let's start
from scratch and build this thing"?

More information about the Python-list mailing list