No module named Image

Homex picture Homex · Aug 19, 2012 · Viewed 187.9k times · Source

Sorry for my grammar, I don't speak English. After I set filebrowser, tinymce, and grappelli, I get this error: No module named Image

try:
    from PIL import Image
except ImportError:
    import Image

I set it to PIL but it didn't solve the problem. my platform windows

If i want: pip install PIL

`c:\Users\Kim\BitNami DjangoStack projects\homex8>pip install PIL
Downloading/unpacking PIL
  Running setup.py egg_info for package PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py

Installing collected packages: PIL
  Running setup.py install for PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py
    building '_imaging' extension
    error: Unable to find vcvarsall.bat`

I do not understand what that means

Solved problem. reinstall PIL with easy_install, and more movements, here are the details.

Answer

user1119116 picture user1119116 · Aug 23, 2015

You are missing PIL (Python Image Library and Imaging package). To install PIL I used

 pip install pillow

For my machine running Mac OSX 10.6.8, I downloaded Imaging package and installed it from source. http://effbot.org/downloads/Imaging-1.1.6.tar.gz and cd into Download directory. Then run these:

    $ gunzip Imaging-1.1.6.tar.gz
    $ tar xvf Imaging-1.1.6.tar
    $ cd Imaging-1.1.6
    $ python setup.py install

Or if you have PIP installed in your Mac

 pip install http://effbot.org/downloads/Imaging-1.1.6.tar.gz

then you can use:

from PIL import Image

in your python code.