Registry / web-framework / werkzeug

werkzeug

JSON →
library3.1.8pypypi✓ verified 25d ago

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
INSTALL
IMPORT
SIG · WERKZEUG
W
werkzeug
web-frameworkpythonv3.1.8
Install
2.0s avg
Import
248ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.260s · 19.6MB
glibc
py 3.103.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)
Debug
Known issues
breakingDeprecation 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'.
affects: >=0.16.0
gotchaRelative imports can break import paths; prefer absolute imports to avoid issues.
fix
Use absolute imports to ensure correct module resolution.
affects: All
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.
fix
from 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.
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.
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`.
fix
from 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.
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.
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.
Agent activity
64 hits · last 30 days
node
58
OpenAI (training)
1
Resources
werkzeug — pip install werkzeug · libregistry