RuntimeError: NotImplementedError('Unable to find the Python Python Imaging Library. Please view the SDK documentation for details about installing PIL on your system.',).
Through google app engine log i am getting this error. i m trying to upload a image. i have installed PIL but still its showing cannot find. i have installed it in
C:\Python27\Lib\site-packages.
This is the app.yaml
application: uniqueappid
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /static
static_dir: static
- url: /.*
script: main.app
libraries:
- name: jinja2
version: latest
- name: PIL
version: 1.1.7
This happens if the PIL library can not be loaded for ANY reason. I am running OSX so the solution for you might be different for you, but maybe describing what I did will help others.
For me the problem was that my Python 2.7.13 for OSX did not ship with a
yaml
library, and requiring the images library failed because of that. Running this fixed the issue for me:The total installs I needed to get the images API working locally was the following:
The packages need to be installed globally, as they will be used by the API server. Installing the packages locally with
-t
and adding the library directory toappengine_config.py
DID NOT WORK.In addition to this I needed to have the version fixed as 1.1.7 in my app.yaml even though your Pillow version will not be the same:
As mentioned, your problem with loading the library might be different, so here is how I discovered my missing
yaml
dependency:From the following last callstack line I interpreted that my app engine libraries reside in
/Applications/google-cloud-sdk/platform/google_appengine
:By reading the code I figured out that the module which is responsible for detecting if
PIL
is installed isgoogle.appengine.api.images.images_stub
, so I did the following:.. which resulted in the following error:
This allowed me to figure out that the import was failing because of the missing
yaml
module.