[MapProxy] Not loading images ("PIL is not available")

pschneider at pantek.com pschneider at pantek.com
Tue Jul 10 09:28:36 PDT 2012


Hi, just following up on this.

I resolved this problem with PIL by using a different binary version from:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

Other versions, including versions installed via python itself and the binaries found at http://effbot.org/downloads/#pil simply did not work.

I thought I'd post in case someone else runs into the same problem.  I would also include in the docs the a write-up on how to get it working with IIS.  I'd do so myself, but it is outside the scope of the job that caused me to submit the ticket in the first place.

Regards,

Paul


----- Original Message -----
From: pschneider at pantek.com
To: mapproxy at lists.osgeo.org
Sent: Monday, July 9, 2012 3:51:23 PM
Subject: [MapProxy] Not loading images ("PIL is not available")

Hi there, I'm having troubles loading any images from the mapproxy demo WMS.  The machine is a Win2k8 R2 server with apache 2.2, python 2.7.3 and associated tools installed.  I confirm that PIL is installed and importable from the python shell.  To hedge my bets I even reinstalled using the exact procedure on the site.  Since I'm using mod_wsgi, I did not put it in a virtualenv, per the instructions.

The error I keep getting the following errors in my apache below:

"[Mon Jul 09 13:41:29 2012] [error] [client 127.0.0.1] ImportError: PIL is not available, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1] Traceback (most recent call last):, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\wsgiapp.py", line 133, in __call__, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     resp = self.handlers[handler_name].handle(req), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\service\\ows.py", line 38, in handle, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     return self.services[service].handle(req), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\service\\base.py", line 30, in handle, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     return handler(parsed_req), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\service\\wms.py", line 108, in map, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     renderer.render(merger), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\service\\wms.py", line 459, in render, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     layer_merger), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\util\\async.py", line 204, in _single_call, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     result = func(*args), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\service\\wms.py", line 501, in _render_layer, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     layer_img = layer.get_map(self.query), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\layer.py", line 292, in get_map, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     return layer.get_map(query), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\layer.py", line 360, in get_map, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     resp = self._image(src_query), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\layer.py", line 397, in _image, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     tile_collection = self.tile_manager.load_tile_coords(affected_tile_coords, with_metadata=query.tiled_only), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\cache\\tile.py", line 126, in load_tile_coords, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     created_tiles = creator.create_tiles(uncached_tiles), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\cache\\tile.py", line 227, in create_tiles, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     created_tiles = self._create_meta_tiles(meta_tiles), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\cache\\tile.py", line 299, in _create_meta_tiles, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     created_tiles.extend(self._create_meta_tile(meta_tile)), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\cache\\tile.py", line 311, in _create_meta_tile, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     tile_size, self.tile_mgr.image_opts), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\cache\\tile.py", line 463, in split_meta_tiles, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     splitter = TileSplitter(meta_tile, image_opts), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\image\\tile.py", line 96, in __init__, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     self.meta_img = meta_tile.as_image(), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\image\\__init__.py", line 90, in as_image, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     img = Image.open(self._buf), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]   File "C:\\Python27\\lib\\site-packages\\mapproxy\\platform\\image.py", line 39, in __getattr__, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1]     raise ImportError('PIL is not available'), referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
[Mon Jul 09 13:41:30 2012] [error] [client 127.0.0.1] ImportError: PIL is not available, referer: http://localhost/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fjpeg&wms_layer=osm
_______________________________________________
MapProxy mailing list
MapProxy at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapproxy


More information about the MapProxy mailing list