I’m having problems pushing my Django app to Heroku. There seems to be an error with installing PIL. I’ve traditionally had a problem with PIL b/c I’m on Windows, so using pip install or easy_install doesn’t work because it can’t find “vcvarsall.bat”
So as a quick solution, I went to this site and ran teh .exe version of PIL to install. I had problems getting PIL onto my virtual environment, so when creating the virtual environment, I use this
virtualenv --system-site-packages venv
Now I’m using
git push heroku master
and I’m getting this back
Downloading/unpacking PIL==1.1.7 (from -r requirements.txt)
Could not find any downloads that satisfy the requirement PIL==1.1.7 (line 2))
...
Heroku push rejected, failed to compile Python/Django app
! [remote rejected] m aster -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com...'
How can I get past PIL?
I remember having this problem with pip finding PIL. Try using this line instead of PIL=1.1.7 in requirements.txt
http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
Also, you can always remove any module from requirements.txt and replace it with a copy of the module code in your Django root.
For example, with the PIL thing, you could have used that link to download the code, unzipped it, and pasted the PIL inside the resulting Imaging-1.1.7 folder into your Django project root. Would’ve worked just the same.
In general you want to avoid this if possible because it increases the size of your code deployment, but you can do it. It’ll help you get around these issues so you can keep working for now at least.
One case where it might actually be preferable to include the code, rather than just using requirements.txt, is when you are working with a library or module that is poorly documented, and you want to have immediate and quick access to the source code from inside your editor. Probably wouldn’t do it on a production server, but for dev that can be very convenient.