2

When I try and use easy_install PIL it will give me the error:

    File "setup.py", line 182
print "--- using Tcl/Tk libraries at", TCL_ROOT
                                    ^
SyntaxError: invalid syntax

It is extremely annoying and I have tried installing it from a package as well. I've downloaded Imaging-1.1.7 and it gives the same error. I am trying to get the Image module in Python 3.4.1. I've tried installing Pillow 2.4 but it doesn't show up in the module list when I type pydoc3.4 modules and none of the applications even detect it's existence. Please help because I am getting desperate. I am on Mac OS X 10.8.4 with Python 3.4.1.

user3672684
  • 29
  • 1
  • 2

2 Answers2

4

That syntax for print only exists in Python 2.x, where print is a statement. However, it was removed entirely in Python 3.x when print became a function.

This means that your version of PIL is incompatible with Python 3.x. So, you now have two options:

  1. Get a version of PIL that is compatible with Python 3.x. This question has more information on that.

  2. Downgrade to Python 2.x.

Community
  • 1
  • 1
  • how do i install a pillow for my mac os yosemite? i'm seeing .whl links but i don't know how to install them – bonbon.langes Nov 03 '14 at 12:37
  • @bonbon.langes - I'm sorry sir, but my primary operating system is Windows. You should ask a new question about your problem, stating clearly what you want as well as what you have already tried. I only answered this question because the problem was obvious, not because I am an experienced Mac user :) –  Nov 03 '14 at 14:43
  • ah alright no worries. i should have tagged Ned. but the question is also tagged as under mac osx so my question is still valid – bonbon.langes Nov 03 '14 at 15:14
0

I have also tried brew install PIL and pip install PIL and I encountered the same issue, because I'm using python 3.4. But I just solved the problem today. This is thanks to Ned Deily's answer above, which i need to figure out first how to do since i'm not well experienced with pip stuffs.

So to do it, you need to head over to https://pypi.python.org/pypi/Pillow/ and click the latest version. (found version 2.6.1 at the time of this writing). You should see something like Pillow-(version).tar.gz (found Pillow-2.6.1.tar.gz). Just right click it and copy link address if you're using chrome browser and type in the following in your terminal.

pip install https://pypi.python.org/packages/source/P/Pillow/Pillow-2.6.1.tar.gz#md5=4b77fb0c81bbe0c8bf90c6eea960e091

that should do the trick

bonbon.langes
  • 1,718
  • 2
  • 22
  • 37