Open benjimin opened 3 years ago
I was facing the same issue. Have found a local workaround with the following versions. However, now I am not sure if the tested stuff will work with the newest PyWPS; a general solution would be appreciated.
pip install flask==1.1.4 werkzeug==1.0.1 pywps==4.2.11
I am also facing the same issue!
Same here.
Still valid issue. What is the reason of python-flask to be broken for so long time?
Update:
pip install flask==1.1.4 werkzeug==1.0.1 pywps==4.2.11 MarkupSafe==2.0.1
Also got the same problem:
pywps: 4.5.2 flask: 2.2.2 python:3.10.6
I removed Area
from the demo project under the import and Processes. Than the demo would start!
FYI, for anyone still encountering the issue:
If you just want to use PyWPS with Flask, you do not need this repo (which is apparently just a demo, and seems defunct and overcomplicated anyway). Instead follow the standard instructions for PyWPS (perhaps in combination with the Flask instructions for WSGI apps).
A fairly minimal example goes roughly like this:
import flask
import pywps
class dummy(pywps.Process):
def __init__(self):
super().__init__(handler=self._handler,
identifier='dummyproc',
title='Dummy Process',
inputs=[pywps.LiteralInput('input', "Some input", data_type='string')],
outputs=[pywps.LiteralOutput('response', "Some output", data_type='string')])
def _handler(self, req, resp):
resp.outputs['response'].data = req.inputs['input'][0].data + " and foo"
service = pywps.Service([dummy()])
app = flask.Flask(__name__)
app.route('/wps', methods=['GET', 'POST'])(lambda: service)
app.run()
Then, in a separate process, you can test it with something like:
import owslib.wps
client = owslib.wps.WebProcessingService('http://127.0.0.1:5000/wps')
client.getcapabilities()
print(client.processes)
For real applications you would use one of the pywps geometry input types.
FYI, for anyone still encountering the issue:
If you just want to use PyWPS with Flask, you do not need this repo (which is apparently just a demo, and seems defunct and overcomplicated anyway). Instead follow the standard instructions for PyWPS (perhaps in combination with the Flask instructions for WSGI apps).
A fairly minimal example goes roughly like this:
... For real applications you would use one of the pywps geometry input types.
For testing, if you have QGIS, you can install the WPS Client (enable experimental plugins first).
There seems to be an incompatibility between the latest versions of
pywps
(4.5.0) andpywps-flask
(master branch as of today).For what it's worth, I also tried using an earlier version of
pywps
, but that led to other dependency version conflicts.