Can't instantiate class

Fredrik Lundh fredrik at pythonware.com
Sun Nov 6 13:02:06 EST 2005


David Mitchell wrote:

> Ok, so If use your first suggestion (db = DataUtil.DataUtil()
> ), I get this error:
>
> AttributeError: 'module' object has no attribute 'DataUtil'
>
> If I try importing the class directly (from DataUtil import DataUtil),
> I get this error:
>
> ImportError: cannot import name DataUtil

add

    import DataUtil

    print DataUtil.__file__
    print dir(DataUtil)

and make sure that you're really importing the module you think
you're importing (the first print statement prints the module file-
name, the second the contents)

</F>






More information about the Python-list mailing list