gana2188 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

PIL not installed on gcloud containers? #99

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
attempted to access Image object from uploaded image file's blobkey:

from google.appengine.api.images import Image
img = Image(blob_key=myImageRefObj.blobKey)  

What is the expected output? What do you see instead?

This works fine in the old simple dev_appserver.py world. But using gcloud to 
launch in docker containers I get:
" NotImplementedError('Unable to find the Python PIL library.  Please '
NotImplementedError: Unable to find the Python PIL library.  Please view the 
SDK documentation for details about installing PIL on your system."

What is the output of 'gcloud info'?

ERROR: Exception while handling service_name: "images"
method: "Transform"
request: 
"\n\034\n\000\022\0301sepyLyZaRSJhp0R46iczQ==\022\022\010d\020dX\000e\000\000\00
0?m\000\000\000?p\000\032\002\010\000\"\002\010\000"
request_id: "yTXvxnelwv"

Traceback (most recent call last):
  File "/Users/philipteare/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 196, in _handle_POST
    api_response = _execute_request(request).Encode()
  File "/Users/philipteare/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 157, in _execute_request
    make_request()
  File "/Users/philipteare/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 149, in make_request
    request_id)
  File "/Users/philipteare/google-cloud-sdk/platform/google_appengine/google/appengine/api/images/images_not_implemented_stub.py", line 54, in MakeSyncCall
    raise NotImplementedError('Unable to find the Python PIL library.  Please '
NotImplementedError: Unable to find the Python PIL library.  Please view the 
SDK documentation for details about installing PIL on your system.

ERROR    2014-12-28 21:30:50,540 webapp2.py:1552] 'NoneType' object has no 
attribute '__getitem__'

Please provide any additional information below.

I've tried using the default standard python 2.7 module, and a 'vm'. With the 
vm I made a couple fo attempts to intall PIL via the docker file and the 
requirements file, but not usre if I was doing this right. The vm built and 
ran, but the same line bugged out with the same error.

IMPORT (I think):
inspecting the img object made by img = Image(blob_key=myImageRefObj.blobKey)  
gives the error shown below
(Pdb) p img.width
*** NotImageError: NotImageError('Dimensions unavailable for blob key input',)

Looking in the blob store viewer, the image is in there, and the key is 
correct. I've tried with various images, and they all bahve the same way.

Original issue reported on code.google.com by p...@evolu8.com on 28 Dec 2014 at 10:29

GoogleCodeExporter commented 8 years ago
I'm looking into this.

Original comment by jeffvaug...@google.com on 20 Jan 2015 at 8:31

GoogleCodeExporter commented 8 years ago
Typically you should install PIL independently by the user and should wind up 
in site packages.  gcloud disables site packages by default.  If you set 
CLOUDSDK_PYTHON_SITEPACKAGES=1 it should work.

Original comment by jeffvaug...@google.com on 22 Jan 2015 at 5:02