Werkzeug

raw JSON →
3.1.7 verified Tue May 12 auth: no python install: verified quickstart: stale

Werkzeug is a comprehensive WSGI web application library, currently at version 3.1.7, released on March 28, 2026. It offers a wide range of utilities for building web applications in Python, with a release cadence of regular updates addressing both features and fixes.

pip install werkzeug
error ModuleNotFoundError: No module named 'werkzeug.security'
cause `generate_password_hash` and `check_password_hash` were moved from the top-level `werkzeug` module to `werkzeug.security` in Werkzeug 0.15.
fix
from werkzeug.security import generate_password_hash, check_password_hash
error AttributeError: 'Request' object has no attribute 'json'
cause The Werkzeug `Request` object (used by Flask) does not expose JSON body data via a direct `.json` attribute; it provides methods to parse it.
fix
Use request.get_json() to parse JSON data from the request body. If using Flask's request proxy, flask.request.json is available and calls get_json() internally.
error ImportError: cannot import name 'cached_property' from 'werkzeug.utils'
cause `cached_property` was deprecated in `werkzeug.utils` and later removed in Werkzeug 2.1+, in favor of the standard library's `functools.cached_property`.
fix
from functools import cached_property
error OSError: [Errno 98] Address already in use
cause Another process is already listening on the specified port (e.g., 5000), preventing the Werkzeug development server from starting.
fix
Terminate the process currently using the port, or configure your application to run on a different port. On Linux/macOS, lsof -i :<PORT> and kill -9 <PID> can help.
breaking Deprecation of top-level attributes in 'werkzeug' module; direct imports are now required. Failure to update may lead to ImportErrors, AttributeErrors, or application hangs/timeouts.
fix Update imports to use direct module paths, e.g., 'from werkzeug.urls import url_quote'.
gotcha Relative imports can break import paths; prefer absolute imports to avoid issues.
fix Use absolute imports to ensure correct module resolution.
python os / libc status wheel install import disk
3.10 alpine (musl) - - 0.23s 19.6M
3.10 slim (glibc) - - 0.19s 20M
3.11 alpine (musl) - - 0.33s 21.7M
3.11 slim (glibc) - - 0.28s 22M
3.12 alpine (musl) - - 0.33s 13.5M
3.12 slim (glibc) - - 0.29s 14M
3.13 alpine (musl) - - 0.27s 13.1M
3.13 slim (glibc) - - 0.28s 14M
3.9 alpine (musl) - - 0.18s 19.0M
3.9 slim (glibc) - - 0.15s 20M

A minimal WSGI application using Werkzeug to respond with 'Hello, World!'

from werkzeug.wrappers import Request, Response
from werkzeug.serving import run_simple

def application(environ, start_response):
    request = Request(environ)
    response = Response('Hello, World!', mimetype='text/plain')
    return response(environ, start_response)

if __name__ == '__main__':
    run_simple('localhost', 4000, application)