Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error exit status 2 trying to install PIL with pip in virtualenv on windows 7

Trying to install PIL via pip in my virtualenv. However I get this error.

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IlibImaging -Ic:\My_Pro
jects\testenv\include -Ic:\My_Projects\testenv\PC /Tc_imaging.c /Fobuild\temp.win32-2.7\Release\_imaging.obj

_imaging.c

_imaging.c(75) : fatal error C1083: Cannot open include file: 'Python.h': No such file or directory

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2

----------------------------------------
Command c:\My_Projects\testenv\Scripts\python.exe -c "import setuptools;__file__='C:\\My_Projects\\testenv\\pinax-solcia
l-site\\build\\PIL\\setup.py';execfile(__file__)" install --single-version-externally-managed --record c:\users\darren\a
ppdata\local\temp\pip-fdzgwn-record\install-record.txt failed with error code 1
Storing complete log in C:\Users\Darren\AppData\Roaming\pip\pip.log

I looked over at this question which suggests installing python-dev but that user was on Ubuntu. I'm on WIndows 7 and not sure how to solve my issue.

Thanks.

like image 665
darren Avatar asked Feb 17 '11 13:02

darren


1 Answers

It looks as if the VisualStudio compiler is not finding the Python development sources. Maybe you need to set a specific environment variable?

This blog post seems to suggest that you need to add c:\Python27 and c:\Python27\bin to your path. Maybe that's what is missing?

PIL is also known for having issues with setuptools. Have you tried pillow?

like image 107
ubik Avatar answered Nov 14 '22 22:11

ubik