概述
近期想用PIL做一个图片对比的功能
from PIL import Image
互相学习android自动化测试,请关注我的微博:weibo.com/ganchaojiang
上面这个语句,发现PIL可以在python shell和IDE里面都可以使用,放到pydev里面,eclipse就一直提示Unresolved 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
不用谢
最后
以上就是虚幻心锁为你收集整理的pydev python eclipse PIL 提示Unresolved import: Image 互相学习android自动化测试,请关注我的微博:weibo.com/ganchaojiang 的全部内容,希望文章能够帮你解决pydev python eclipse PIL 提示Unresolved import: Image 互相学习android自动化测试,请关注我的微博:weibo.com/ganchaojiang 所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复