[英]How can I use PIL with Netbeans 6.8 (Python version 2.6.5)
I have installed Python Imaging Library (PIL) version 1.1.7 on a Windows 7 computer. 我已经在Windows 7计算机上安装了Python Imaging Library(PIL)版本1.1.7。 I have configured Netbeans to use Python (instead of Jython).
我已将Netbeans配置为使用Python(而不是Jython)。 I added a reference to C:\\Python26\\Lib\\site-packages\\PIL to the project but when I attempt this code:
我向项目添加了对C:\\ Python26 \\ Lib \\ site-packages \\ PIL的引用,但是当我尝试此代码时:
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
ImportError:未安装_imaging C模块
The _imaging.pyd file exists and is in the right directory. _imaging.pyd文件存在并且位于正确的目录中。 Furthermore, Python (from the command line) can load PIL and Image and execute the code that I posted above successfully.
此外,Python(从命令行)可以加载PIL和Image并成功执行我上面发布的代码。 Can anyone enlighten me as to what I am doing wrong?
谁能启发我我做错了什么? Thank you!
谢谢!
Solved. 解决了。 Project was incorrectly using Jython instead of Python.
项目错误地使用了Jython而不是Python。 Although I configured Python as the default Python instance in the main Netbeans settings, that change didn't propagate to my project.
尽管我在主要的Netbeans设置中将Python配置为默认的Python实例,但是该更改并未传播到我的项目中。 Setting it in the projects properties fixed it.
在项目属性中设置它可以修复它。 Jython is known to have issues with PIL.
Jython已知与PIL有关。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.