Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PIP/easy_install PIL in Virtualenv vcvarsall.bat error Windows 7

So I know there's a fair amount of documentation on this already, but I just can't seem to get it to work. I'm deploying a Django app to Heroku, and am trying to install PIL into my virtualenv (a main part of the app requires user uploaded images).

I've tried both

easy_install PIL

and

pip install PIL

and everyone the installation ends in

error: Unable to find vcvarsall.bat.

How can I get PIL into my virtualenv? Can anyone walk me through it?

Thanks!

like image 671
Chris Yin Avatar asked Nov 03 '12 01:11

Chris Yin


3 Answers

I don't know about Windows, but easy_install PIL does not work well. easy_install pillow (compatible with setuptools) does the trick. It will still need compilation if I remember correctly, and then you could have a look there : Unable to find vcvarsall.bat

like image 187
Steve K Avatar answered Nov 17 '22 08:11

Steve K


PIL required make.exe or nmake.exe, you may need to install visual studio. vcvarsall.bat is part of visual c++. Please install binary package from http://www.lfd.uci.edu/~gohlke/pythonlibs/

like image 1
Danny Hong Avatar answered Nov 17 '22 09:11

Danny Hong


As stated in other answers Pillow is the way to go since PIP is not compatible with setuptools.

So you may just do:

pip install pillow

Now, since you are working on windows you may run into compilation issues. You will need to install a gcc compiler in order for this to work. I just ran into this issue and blogged about this here.

like image 1
Ulises Avatar answered Nov 17 '22 07:11

Ulises