Issues Running Deepzoom-server.py on Apache (Windows)

Ranga Raj snrangaraj at yahoo.com
Tue Mar 22 03:10:35 EDT 2016


Appreciate in advance any help rendered here.Please help me fix the issue with the deepzoom.wsgi. It seems to fail consistently.
I am trying to access svs images in a folder using openslide utilities.Followed the webpage: openslide/openslide
|   |
|   |  |   |   |   |   |   |
| openslide/openslideopenslide - C library for reading virtual slide images |
|  |
| View on github.com | Preview by Yahoo |
|  |
|   |


I have compiled mod_wsgi successfully using VC14 and Python 3.5, Apache 2.4.18

I have verified my Apache configurations for mod_wsgi works fine...
My deepzoom.wsgi file is:------import os, syspath = 'C:/Apache24/htdocs/openslide/deepzoom_server.py'
if path not in sys.path: sys.path.append(os.path.dirname(path))
from deepzoom_server import app as applicationapplication.config.update({'SLIDE_DIR':'C:/DATA/IMAGES/DIR','DEBUG': True,})

-------
Added the following to httpd.conf-------
<VirtualHost *:8000> ServerName wsgihost    DocumentRoot C:/Apache24/htdocs/openslide    WSGIScriptAlias /wsgi C:/Apache24/htdocs/openslide/wsgi_handler.wsgi
    WSGIScriptAlias /deepzoom C:/Apache24/htdocs/openslide/deepzoom.wsgi</VirtualHost>
-------
I have no issues when I go to http://localhost:8000/wsgi-------Sample WSGI code is:import os, sys
def application(environ, start_response):    status = '200 OK'    out0 = b'sys.platform = %s\n' % bytes(repr(sys.platform), 'utf-8')    out1 = b'sys.version = %s\n' % bytes(repr(sys.version), 'utf-8')    out2 = b'sys.prefix = %s\n' % bytes(repr(sys.prefix), 'utf-8')     out3_1 = b'sys.path = \n'     path = os.path.dirname('C:/Apache24/htdocs/openslide/deepzoom_server.py')    if path not in sys.path: sys.path.append(path)    #out3 = b'sys.path = %s\n' % bytes(repr(sys.path), 'utf-8')    out3 = bytes(('--\n  '.join(sys.path)),'utf-8')    out3_2 = b'\n' 
    out4_1 = b'sys.modules = \n'     out4 = b'sys.modules = %s\n' % bytes(repr(sys.modules), 'utf-8')    #out4 = bytes(('--\n  '.join(sys.modules)),'utf-8')    out4_2 = b'\n' 
    output = b'%s%s%s%s%s%s%s%s%s' % (out0,out1,out2,out3_1,out3,out3_2,out4_1,out4,out4_2)    response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))]        start_response(status, response_headers)        return [output]
-------I am getting a server error when I execute http://localhost:8000/deepzoom
The error_log of Apache has these entries...-------mod_wsgi (pid=12664): Target WSGI script 'C:/Apache24/htdocs/openslide/deepzoom.wsgi' cannot be loaded as Python module.mod_wsgi (pid=12664): Exception occurred processing WSGI script 'C:/Apache24/htdocs/openslide/deepzoom.wsgi'.Traceback (most recent call last):\r  File "C:/Apache24/htdocs/openslide/deepzoom.wsgi", line 6, in <module>\r    from deepzoom_server import app as application\r  File "C:/Apache24/htdocs/openslide\\deepzoom_server.py", line 23, in <module>\r    import openslide\r  File "<frozen importlib._bootstrap>", line 969, in _find_and_load\r  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked\r  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked\r  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible\r  File "C:\\Users\\myself\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\openslide_python-1.1.0-py3.5-win-amd64.egg\\openslide\\__init__.py", line 29, in <module>\r    from openslide import lowlevel\r  File "<frozen importlib._bootstrap>", line 969, in _find_and_load\r  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked\r  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked\r  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible\r  File "C:\\Users\\myself\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\openslide_python-1.1.0-py3.5-win-amd64.egg\\openslide\\lowlevel.py", line 39, in <module>\r    _lib = cdll.LoadLibrary('libopenslide-0.dll')\r  File "C:\\Users\\myself\\AppData\\Local\\Programs\\Python\\Python35\\Lib\\ctypes\\__init__.py", line 425, in LoadLibrary\r    return self._dlltype(name)\r  File "C:\\Users\\myself\\AppData\\Local\\Programs\\Python\\Python35\\Lib\\ctypes\\__init__.py", line 347, in __init__\r    self._handle = _dlopen(self._name, mode)\rOSError: [WinError 193] %1 is not a valid Win32 application\r
-------
Regards - RR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20160322/a93260ea/attachment-0001.html>


More information about the openslide-users mailing list