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
One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.
Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process.
pip is the preferred installer program. Starting with Python 3.4, it is included by default with the Python binary installers. A virtual environment is a semi-isolated Python environment that allows packages to be installed for use by a particular application, rather than being installed system wide.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With