views:

12

answers:

1

Hi all,

I have installed Python Imaging Library (PIL) version 1.1.7 on a Windows 7 computer. I have configured Netbeans to use Python (instead of Jython). I added a reference to C:\Python26\Lib\site-packages\PIL to the project but when I attempt this code:

import Image, ImageDraw

img = Image.new("RGB", (100,150),(255,255,255))

I get the following error:

ImportError: The _imaging C module is not installed

The _imaging.pyd file exists and is in the right directory. Furthermore, Python (from the command line) can load PIL and Image and execute the code that I posted above successfully. Can anyone enlighten me as to what I am doing wrong? Thank you!

A: 

Solved. Project was incorrectly using Jython instead of Python. Although I configured Python as the default Python instance in the main Netbeans settings, that change didn't propagate to my project. Setting it in the projects properties fixed it. Jython is known to have issues with PIL.

SimpleCoder