[Python.NET] Can't Import PIL Image

Jen Schonlandy at hotmail.com
Sun Sep 17 02:17:30 CEST 2006

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

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


def test(srcImg):
	im = Image.open(srcImg)

so the problem is caused by unable to import Image
have any solution? thx in advance

View this message in context: http://www.nabble.com/Can%27t-Import-PIL-Image-tf2284201.html#a6345332
Sent from the Python - pythondotnet forum at Nabble.com.

More information about the PythonDotNet mailing list