1

I am new to Python and also Google App Engine, but I am stuck up with the installations of it and its compatibility. I am using mac os -x and eclipse helios and got the pyDev plugin installed but in spite of all this i am still getting errors. . .

Whenever I try to import PIL from the terminal it does not give me any errors meaning that it was installed successfully but when I use the same Import in the eclipse file. I getting the compilation error as:

 "Unresolved Import"

Please help me with this

Somehow I tried to fix that, then it gives me the error saying that imaging : no matching architecture in universal wrapper

when I changed the architecture to 32 bit ti gives me this in Eclipse Log :

Traceback (most recent call last):
  File "/Users/Vinay/Documents/EclispeHeliosWorkspace/helloworld/Main.py", line 7, in <module>
    im.show()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/Image.py", line 1483, in show
    _show(self, title=title, command=command)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/Image.py", line 2123, in _show
    apply(_showxv, (image,), options)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/Image.py", line 2127, in _showxv
    apply(ImageShow.show, (image, title), options)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/ImageShow.py", line 41, in show
    if viewer.show(image, title=title, **options):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/ImageShow.py", line 66, in show
    self.show_image(image, **options)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/ImageShow.py", line 85, in show_image
    return self.show_file(self.save_image(image), **options)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/ImageShow.py", line 81, in save_image
    return image._dump(format=self.get_format(image))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/Image.py", line 488, in _dump
    self.load()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/ImageFile.py", line 164, in load
    self.load_prepare()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/ImageFile.py", line 231, in load_prepare
    self.im = Image.core.new(self.mode, self.size)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/Image.py", line 37, in __getattr__
    raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed

What do I do :( ?

Vasilis G.
  • 7,556
  • 4
  • 19
  • 29

2 Answers2

1

PIL has some specific instructions for installation. Have you seen them?

Installing PIL on GAE

  1. Download the PIL .dmg file. For example, you can download the PIL 1.1.6 .dmg file from http://pythonmac.org/packages/py25-fat/index.html.
  2. Double-click on the installer to start the installation process.
  3. Choose the correct directory. Finish the installation.

This is just for use in your local development environment. When you upload it'll use a GAE supplied version of PIL which means you also have to update your app.yaml file like so:

libraries:
- name: PIL
  version: "1.1.7"

as detailed here.

IIRC You will want to install it "inside" your application directory itself so it can be accessed by your application locally. Not sure about that on the MAC however.

Paul Collingwood
  • 9,053
  • 3
  • 23
  • 36
0

I just installed Pillow (using: sudo pip install Pillow) to get PIL in Python 2.7.6 on OS X 10.8.5 Mountain Lion.

I had the same issue in PyDev with Eclipse Kepler. To fix:

Go to:

Eclipse -> Preferences -> PyDev -> Interpreter - Python -> Libraries and click on "New Folder."

Then navigate to:

/Library/Python/2.7/site-packages

and click Open, and then Apply, then OK.

Then I quit Eclipse and restarted -- problem fixed. :)