Werkzeug 1.0.0 has removed deprecated code, including all of werkzeug.contrib. You should use alternative libraries for new projects. werkzeug.contrib.session was extracted to secure-cookie.


If an existing project you're using needs something from contrib, you'll need to downgrade to Werkzeug<1:

pip3 install Werkzeug<1
Answer from Aleksey on Stack Overflow
🌐
GitHub
github.com › Azure-Samples › ms-identity-python-webapp › issues › 16
ModuleNotFoundError: No module named 'werkzeug.contrib' · Issue #16 · Azure-Samples/ms-identity-python-webapp
February 12, 2020 - Traceback (most recent call last): File "app.py", line 11, in <module> Session(app) File "/home/mrhoads/development/ms-identity-python-webapp/venv/lib/python3.7/site-packages/flask_session/__init__.py", line 54, in __init__ self.init_app(app) File "/home/mrhoads/development/ms-identity-python-webapp/venv/lib/python3.7/site-packages/flask_session/__init__.py", line 61, in init_app app.session_interface = self._get_interface(app) File "/home/mrhoads/development/ms-identity-python-webapp/venv/lib/python3.7/site-packages/flask_session/__init__.py", line 93, in _get_interface config['SESSION_USE_SIGNER'], config['SESSION_PERMANENT']) File "/home/mrhoads/development/ms-identity-python-webapp/venv/lib/python3.7/site-packages/flask_session/sessions.py", line 313, in __init__ from werkzeug.contrib.cache import FileSystemCache ModuleNotFoundError: No module named 'werkzeug.contrib'
Author   Azure-Samples
🌐
Reddit
reddit.com › r/cs50 › no module named werkzeug.contrib
r/cs50 on Reddit: No module named werkzeug.contrib
April 6, 2020 -

Hello,

I'm trying to check my Finance application code (CS50, PSET 8), but ran into an error on the second check (application starts up). The error I get is ModuleNotFoundError: No module named 'werkzeug.contrib'

I've been reading different threads, and it seemed like the problem occurred because the newest version of Werkzeug does not include the 'werkzeug.contrib' modules. I've tried to downgrade the werkzeug version to 0.16.0, but I don't think its working in this case, as I still have the same issue.

These are the errors I get, and I am trying to figure out how these were using the werkzeug.contrib and how I could fix the error:

File "/usr/local/lib/python3.7/site-packages/check50/runner.py", line 142, in wrapper state = check(*args)
File "/home/ubuntu/.local/share/check50/cs50/problems/finance/init.py", line 22, in startup Finance().get("/").status(200)
File "/home/ubuntu/.local/share/check50/cs50/problems/finance/init.py", line 172, in init super().init(self.APP_NAME)
File "/usr/local/lib/python3.7/site-packages/check50/flask.py", line 34, in init mod = internal.import_file(path.stem, path.name)
File "/usr/local/lib/python3.7/site-packages/check50/internal.py", line 178, in import_file spec.loader.exec_module(mod)
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

Has anyone encountered similar or able to help me to solve this?

🌐
GitHub
github.com › odoo › odoo › issues › 189171
[18.0] module: ModuleNotFoundError: No module named 'werkzeug' · Issue #189171 · odoo/odoo
November 29, 2024 - Nov 29 14:05:15 ip-172-26-9-241 python3.12[4689]: File "/opt/odoo18/odoo/init.py", line 49, in Nov 29 14:05:15 ip-172-26-9-241 python3.12[4689]: _monkeypatches.patch_all() Nov 29 14:05:15 ip-172-26-9-241 python3.12[4689]: File "/opt/odoo18/odoo/_monkeypatches/init.py", line 30, in patch_all Nov 29 14:05:15 ip-172-26-9-241 python3.12[4689]: from .werkzeug_urls import patch_werkzeug Nov 29 14:05:15 ip-172-26-9-241 python3.12[4689]: File "/opt/odoo18/odoo/_monkeypatches/werkzeug_urls.py", line 14, in Nov 29 14:05:15 ip-172-26-9-241 python3.12[4689]: from werkzeug import urls Nov 29 14:05:15 ip-172-26-9-241 python3.12[4689]: ModuleNotFoundError: No module named 'werkzeug' Nov 29 14:05:15 ip-172-26-9-241 systemd[1]: odoo18.service: Main process exited, code=exited, status=1/FAILURE Nov 29 14:05:15 ip-172-26-9-241 systemd[1]: odoo18.service: Failed with result 'exit-code'.
Author   odoo
🌐
Serverless Forums
forum.serverless.com › serverless framework
[ERROR] ModuleNotFoundError: No module named 'werkzeug._compat' - Serverless Framework - Serverless Forums
August 5, 2021 - Hi team, I have create a sample Flask API app and deployed it using aws keys. I did this following instructions on this page: https://app.serverless.com/?package=aws-python-flask-api Deployed it from the command-line on my machine - but now when I try accessing the published endpoints I am getting: {“message”: “Internal server error”} I went into the CloudWatch for the app see the following error: [ERROR] ModuleNotFoundError: No module named 'werkzeug._compat' Traceback (most recent call ...
🌐
Stack Overflow
stackoverflow.com › questions › 75578785 › no-module-named-werkzeug-local
python - No module named werkzeug.local - Stack Overflow
This means, the required module 'werkzeug' is not installed in your Python environment. you can install it using this command pip install werkzeug .
🌐
GitHub
github.com › odoo › odoo › issues › 25254
No module named 'werkzeug' · Issue #25254 · odoo/odoo
June 14, 2018 - Traceback (most recent call last): File "./odoo-bin", line 5, in import odoo File "/home/odoousr/odoo-repo/odoo/init.py", line 84, in from . import modules File "/home/odoousr/odoo-repo/odoo/modules/init.py", line 8, in from . import db, graph, loading, migration, module, registry File "/home/odoousr/odoo-repo/odoo/modules/graph.py", line 10, in import odoo.tools as tools File "/home/odoousr/odoo-repo/odoo/tools/init.py", line 9, in from .misc import * File "/home/odoousr/odoo-repo/odoo/tools/misc.py", line 25, in import werkzeug.utils ImportError: No module named 'werkzeug'
Author   odoo
Find elsewhere
🌐
GitHub
github.com › tensorflow › tensorflow › issues › 7077
TensorBoard ImportError: No module named werkzeug · Issue #7077 · tensorflow/tensorflow
January 25, 2017 - 2017-01-25 17:02:36: I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcudnn.so.5 locally 2017-01-25 17:02:36: I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcufft.so.8.0 locally 2017-01-25 17:02:36: I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcuda.so.1 locally 2017-01-25 17:02:36: I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcurand.so.8.0 locally Traceback (most recent call last): File "/usr/local/bin/tensorboard", line 9, in load_entry_point('t
Author   tensorflow
🌐
GitHub
github.com › pallets › werkzeug › issues › 1663
ModuleNotFoundError: No module named 'werkzeug.wsgi.middleware'; 'werkzeug.wsgi' is not a package · Issue #1663 · pallets/werkzeug
November 16, 2019 - When using from werkzeug.wsgi import DispatcherMiddleware I get a DeprecationWarning: DeprecationWarning: The import 'werkzeug.wsgi.DispatcherMiddleware' is deprecated and will be removed in Werkzeug 1.0. Use 'from werkzeug.wsgi.middlewa...
Author   pallets
🌐
GitLab
gitlab.com › flectrahq › flectra › #290
ModuleNotFoundError: No module named 'werkzeug.contrib' (start fails) (#290) · Issues · FlectraHQ / Flectra · GitLab
1.7.20210509 on Debian Bullseye amd64 Summary Immediately after package installation the flectra service has failed to start. Steps to reproduce...
🌐
Stack Overflow
stackoverflow.com › questions › 61745614 › importerror-no-module-named-werkzeug-utils
python - ImportError: No module named werkzeug.utils - Stack Overflow
Odoo 9.0 is no longer supported since long ago, and it only works with Python 2, so you'd have to install python2-werkzeug instead (if available). Only Odoo 11.0 and newer run under Python 3. ... Sign up to request clarification or add additional context in comments. ... i get E: Unable to locate package python2-werkzeug when I give python2-werkzeug 2020-05-12T10:35:18.933Z+00:00
🌐
Frappe
discuss.frappe.io › install / update › setup
Bench start failing - ModuleNotFoundError: No module named 'werkzeug' - Setup - Frappe Forum
April 21, 2020 - bench start /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used self.stdout = io.open(c2pread, 'rb', bufsize) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used self.stdout = io.open(c2pre...
🌐
RoseIndia
roseindia.net › answers › viewqa › pythonquestions › 251611-ModuleNotFoundError-No-module-named-Werkzeug.html
ModuleNotFoundError: No module named 'Werkzeug'
After the installation of Werkzeug python library, ModuleNotFoundError: No module named 'Werkzeug' error will be solved.
🌐
PyPI
pypi.org › project › Werkzeug
Werkzeug · PyPI
Werkzeug is a comprehensive WSGI web application library.
      » pip install Werkzeug
    
Published   Apr 02, 2026
Version   3.1.8