Menu

eclipse does not recognize PIL module

nethero
2011-10-03
2013-03-15
  • nethero

    nethero - 2011-10-03

    I'm running this code in Eclipse…

    from PIL import Image
    im = Image.open("download.png")
    im.rotate(45).show()
    

    This code runs using my command line python interpreter. My problem is that the PIL package always shows an error in Eclipse. It keeps saying that this import is "Unresolved" even though the code runs fine. Why is this happening? The /usr/lib/python2.7/dist-packages/PIL is in the System PYTHONPATH in Eclipse. I tried deleting and recreating the interpreter in Eclipse and there was still an error.

    Using…
    Eclipse 3.7
    pyDev 2.2.2.2011082312
    Ubuntu 11.04
    python 2.7.1

     
  • Joost Rekveld

    Joost Rekveld - 2011-10-05

    Did you try adding PIL to the Forced Builtins ? (preferences->pydev_interpreter, next to libraries)
    I have had this with largish packages, also do not really understand why it runs but is not recognized by the little man that looks at the code..

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.