近期想用PIL做一个图片对比的功能
from PIL import Image
最后还是stackoverflow给力,摘出原话:
I've found two different ways to fix this:
Go to Preferences -> PyDev -> Interpreter - Python -> Forced Builtins, click "New..." and enter "PIL" (without the quotes). Click OK twice and restart Eclipse.
Change your import statement to "import Image" instead of "from PIL import Image".
方法2种,请使用第一种:
打开eclipse->window->Pydev->interpreter python->Forced Builtins->New->输入PIL->Apply-> OK
错误提示就消失了,再输入import ,然后输入P,alt+/提示一下,看看是否有PIL提示,如有,代表已ok
不用谢