I accidentally deleted my virtualenv that I had generated a few weeks ago. I tried to reinstall my dependencies and now I get an error on startup when before it would work fine. Using .env/bin/uwsgi --http :9800 --file ./wsgi.py --callable app also breaks with the same traceback. This was after I noticed a vulnerability was in the Werkzeug module of GitHub but hadn't reinstalled a new version. Can't seem to find a working version setup now.
I'm able to run from werkzeug.wrapper.json import JSONmixin in the interpreter without failure.
flask run should run my application.
flask run returns an import error with werkzeug for JSONmixin. Below is the traceback:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/flask", line 6, in <module>
from flask.cli import main
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/__init__.py", line 21, in <module>
from .app import Flask
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/app.py", line 69, in <module>
from .wrappers import Request
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/wrappers.py", line 14, in <module>
from werkzeug.wrappers.json import JSONMixin as _JSONMixin
ModuleNotFoundError: No module named 'werkzeug.wrappers.json'; 'werkzeug.wrappers' is not a package
Had to run pip install -U flask outside of my virtualenv
Most helpful comment
Had to run
pip install -U flaskoutside of my virtualenv