Are you certain that you have installed PIL into the instance of Python that you are using with Python for .NET? This is easy to forget - if you are using the 'built-in' python install that comes with Python for .NET, it will *not* know about any packages you may have installed in a pre-existing Python install.
-Brian On 9/16/06 8:17 PM, "Jen" <[EMAIL PROTECTED]> wrote: > > I have a py file using PIL to handle some image staff, and want to invoke its > method in C# > The py file works fine under Python or ActivePython (2.3), it looks sth like > this: > > import Image, sys > def convert(srcImg): > im = Image.open(srcImg).convert("1").rotate(0) > data = im.tostring("raw", "1;I") > ... > return "".join(strList) > > but when invoked in C# it comes with a Python.Runtime.PythonException > I try to debug the problem, found out that > > def test(srcImg): > return "some thing" > > works fine > > but > > def test(srcImg): > im = Image.open(srcImg) > > not, > so the problem is caused by unable to import Image > have any solution? thx in advance _________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet