[Python.NET] error: ImportError: dynamic module does not define
init function (initASSEMBLYNAME)
Brian Lloyd
brian at zope.com
Wed Jan 14 09:36:58 EST 2004
> when loading a mixed managed c++ library that i use as .net
> wrapper for my object model, i get
>
> >>> import QuenceNET
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: dynamic module does not define init function (initQuenceNET)
>
> does anyone have specific background information on that error
> and how i can avoid it?
>
> there is no problem using the assembly in .net. i was trying to
> import the library after changing to the directory where the dll
> is located.
I think you just need to change it to 'import CLR.QuenceNET'
The 'CLR' prefix is important, as that is how the runtime is
able to distinguish managed imports from plain Python imports.
If you don't go through CLR, the standard Python importer will
try to import the dll as a Python C extension (which gives the
error you're seeing).
Hope this helps,
Brian Lloyd brian at zope.com
V.P. Engineering 540.361.1716
Zope Corporation http://www.zope.com
More information about the PythonDotNet
mailing list