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 OverflowWerkzeug 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
You will need to downgrade werkzeug version from 1.0.0 to 0.16.0
This solved the problem for me.
Just run the following commands in your project:
python3 -m pip uninstall werkzeug
and then
python3 -m pip install werkzeug==0.16.0
Everything goes smooth up until step 6 'Run flask run to start up your Flask application.'
Apparently there is a werkzeug.contrib module my system doesn't have, and I can't seem to install it. You will see that some version of werkzeug is already on my machine from when I run the pip3 install -r requirements.txt code
https://pastebin.com/embed_iframe/b8LSjpGe
Is there a way around this?
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?
I am asumming, that the wrong version of Werkzeug was installed in the fist place. This usually happens, when you have 2 versions of python installed, and you use 'pip' for installing dependancies rather than using 'pip3'. Hope this helped!
I had this problem with Yocto while installing python-flask from: http://git.yoctoproject.org/git/meta-virtualization.
The solution was to manually add python-werkzeug to my yocto image as well. I suspect that python-flask should depend upon python-werkzeug. Additionally, I had to add python-jinja2 as well to the image.
» pip install Werkzeug