[IronPython] problem with import, packages, and IronPython 1.1
pierrejules.tremblay at gmail.com
Mon Feb 2 22:50:30 CET 2009
We embedded IronPython 1.1 in our application. Unfortunately I am running
into problems accessing .NET assemblies in Python.
In one situation, if I create a module (let's call it mymodule.py) and put
it in sys.path, with the following code in it:
from System.Diagnostics import Process
p = Process()
and then send the IronPython interpreter a script that imports mymodule and
calls foo(), everything works fine:
p = mymodule.foo()
However, if mymodule.py is "packaged" in a subdirectory, let's say "subdir",
which is in the search path as well and has an empty __init__.py file,
p = subdir.mymodule.foo()
I get: "ImportError: can't find module named Diagnostics". It's as though
the fact that I've "packaged" the module in a directory breaks the way
IronPython gives me bindings to the .NET assemblies... Why should this
break? Am I doing something wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironpython-users