Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install Python Imaging Library using pip

Tags:

python

pip

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

like image 875
Sayem Avatar asked Dec 16 '13 15:12

Sayem


People also ask

Why is pip install not working in Python?

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.

How do I enable pip in Python?

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.

Can you use pip to install Python?

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.


1 Answers

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

like image 195
Totem Avatar answered Oct 30 '22 22:10

Totem