Install & Compatibility
Where this runs
tested against v3.1.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.260s · 19.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.0s · import 0.236s · 20MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
wrap_file
✓ from werkzeug.wsgi import wrap_file
Direct import of 'wrap_file' from 'werkzeug.wsgi' is recommended.
url_quote
✓ from werkzeug.urls import url_quote
Direct import of 'url_quote' from 'werkzeug.urls' is recommended.
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)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'werkzeug.security'
`generate_password_hash` and `check_password_hash` were moved from the top-level `werkzeug` module to `werkzeug.security` in Werkzeug 0.15.
fixfrom werkzeug.security import generate_password_hash, check_password_hash
AttributeError: 'Request' object has no attribute 'json'
The Werkzeug `Request` object (used by Flask) does not expose JSON body data via a direct `.json` attribute; it provides methods to parse it.
fixUse `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.
ImportError: cannot import name 'cached_property' from 'werkzeug.utils'
`cached_property` was deprecated in `werkzeug.utils` and later removed in Werkzeug 2.1+, in favor of the standard library's `functools.cached_property`.
fixfrom functools import cached_property
OSError: [Errno 98] Address already in use
Another process is already listening on the specified port (e.g., 5000), preventing the Werkzeug development server from starting.
fixTerminate 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.
Upgrade
Version history
3.1.8latest on PyPI · released Apr 2, 2026
Audit
Dependencies
flaskrequiredWerkzeug is a core dependency of Flask, providing essential utilities for web development.