如何在Eclipse中添加PIL到PyDev,所以我可以导入它并在我的项目中使用它? [英] How do I add PIL to PyDev in Eclipse, so i could import it and use it in my project?

查看:137
本文介绍了如何在Eclipse中添加PIL到PyDev,所以我可以导入它并在我的项目中使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试与PIL在我的项目中工作,但pydev似乎找不到我的项目。首先我可以看到它,当我进入python shell,我可以导入它,我看到它在python sys.path。第二,我将它添加到日食中的PYTHONPATH。



我重新启动了日食,但是当我尝试从PIL导入图像中做我得到:未解决进口。



任何一个请帮助我在这里,所有其他包,我使用到现在工作的一样的方式....我真的需要使用PIL

解决方案

这里有同样的问题。
通过将 / usr / share / pyshared 添加到window-> preferences-> pydev-> Interpreter - Python中的Libraries选项卡来解决。



有很多 / usr / lib / python * 路径与编译的库(C的东西与python绑定)在哪里已经包含,但不包含 / usr / share ...与源的零件。


I am trying to work with PIL in my project but the pydev can't seem to find it in my project. First of all I can see it when I enter the python shell, I can import it and I see it in the python sys.path. Second, I Added it to the PYTHONPATH in eclipse.

I restarted eclipse, but still, when I try to do "from PIL import Image" I am getting: "unresolved import".

Can any one please help me here, all other packages I used until now worked great the same way.... and i really need to use PIL

解决方案

Had the same problem here. Got it resolved by adding /usr/share/pyshared to the Libraries tab in window->preferences->pydev->Interpreter - Python.

There were a lot of /usr/lib/python* paths with the compiled libraries (the C stuff with python bindings) where included already, but not /usr/share... parts with the source.

这篇关于如何在Eclipse中添加PIL到PyDev,所以我可以导入它并在我的项目中使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆