When trying to install Python Imaging Library(PIL) using PIP, the installation failed with the following error:
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip_build_root/pil/setup.py", line 182
print "--- using Tcl/Tk libraries at", TCL_ROOT
Somebody else faced the same issue but the provided solution was for a different library and didn't work for me. In the official mailing list there's an old entry(2003) which discusses the problem but instead of providing a solution, asked to downgrade PIL and providing a fix later (I prefer not to downgrade).
The pip.log file is provided here: http://pastebin.com/YeBLmMBm
There is a new fork of PIL called Pillow which seems to work more consistently than PIL for a lot of people. It's easy to install also. Look here(for info/docs) and here(to install). Though I think
pip install Pillow
should work