简体   繁体   中英

How do I add PIL to PyDev in Eclipse, so i could import it and use it in my project?

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

Try to go to Window -> Preferences -> Pydev-> Interpreter -> Python Interpreter -> Forced Builtins tab. Then add a PIL entry and apply. I've had the same unresolved import error when tried to import from this particular package (other packages worked fine), and found this information which finally helped me.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM