Azure-Samples / ms-identity-python-webapp

A Python web application calling Microsoft graph that is secured using the Microsoft identity platform
MIT License
293 stars 140 forks source link

ModuleNotFoundError: No module named 'werkzeug.contrib' #57

Closed lcyh closed 3 years ago

lcyh commented 3 years ago

flask.cli.NoAppException flask.cli.NoAppException: While importing "app", an ImportError was raised:

Traceback (most recent call last): File "/Users/luochang/.pyenv/versions/3.7.8/lib/python3.7/site-packages/flask/cli.py", line 240, in locate_app import(module_name) File "/Users/luochang/Desktop/project/game_report_platform/app.py", line 1, in from superset import app File "/Users/luochang/Desktop/project/game_report_platform/superset/init.py", line 32, in from werkzeug.contrib.fixers import ProxyFix ModuleNotFoundError: No module named 'werkzeug.contrib'

This is the problem:
from werkzeug.contrib.fixers import ProxyFix ModuleNotFoundError: No module named 'werkzeug.contrib'

Please give me a plan as soon as possible

lcyh commented 3 years ago

run: pip3 list there are versions:

Python version:Python 3.7.8

Package Version


aiohttp 3.7.3 alembic 1.4.3 amqp 2.6.1 apache-superset 0.38.0 apispec 3.3.2 async-timeout 3.0.1 attrs 20.3.0 Babel 2.9.0 backoff 1.10.0 billiard 3.6.3.0 bleach 3.2.1 Brotli 1.0.9 cachelib 0.1.1 celery 4.4.7 cffi 1.14.4 chardet 3.0.4 click 7.1.2 colorama 0.4.4 contextlib2 0.6.0.post1 croniter 0.3.36 cryptography 3.3.1 decorator 4.4.2 defusedxml 0.6.0 dnspython 2.0.0 email-validator 1.1.2 Flask 1.1.2 Flask-AppBuilder 3.1.1 Flask-Babel 1.0.0 Flask-Caching 1.9.0 Flask-Compress 1.8.0 Flask-JWT-Extended 3.25.0 Flask-Login 0.4.1 Flask-Migrate 2.5.3 Flask-OpenID 1.2.5 Flask-SQLAlchemy 2.4.4 flask-talisman 0.7.0 Flask-WTF 0.14.3 geographiclib 1.50 geopy 2.0.0 gunicorn 20.0.4 humanize 3.1.0 idna 2.10 importlib-metadata 3.1.1 isodate 0.6.0 itsdangerous 1.1.0 Jinja2 2.11.2 jsonschema 3.2.0 kombu 4.6.11 Mako 1.1.3 Markdown 3.3.3 MarkupSafe 1.1.1 marshmallow 3.9.1 marshmallow-enum 1.5.1 marshmallow-sqlalchemy 0.23.1 msgpack 1.0.1 multidict 5.1.0 natsort 7.1.0 numpy 1.19.4 packaging 20.7 pandas 1.1.5 parsedatetime 2.6 pathlib2 2.3.5 pip 20.3.1 polyline 1.4.0 prison 0.1.3 py 1.9.0 pyarrow 1.0.1 pycparser 2.20 PyJWT 1.7.1 pyparsing 2.4.7 pyrsistent 0.17.3 python-dateutil 2.8.1 python-dotenv 0.15.0 python-editor 1.0.4 python-geohash 0.8.5 python3-openid 3.2.0 pytz 2020.4 PyYAML 5.3.1 retry 0.9.2 selenium 3.141.0 setuptools 47.1.0 simplejson 3.17.2 six 1.15.0 slackclient 2.5.0 SQLAlchemy 1.3.20 SQLAlchemy-Utils 0.36.8 sqlparse 0.3.0 typing-extensions 3.7.4.3 urllib3 1.26.2 vine 1.3.0 webencodings 0.5.1 Werkzeug 1.0.1 WTForms 2.3.3 WTForms-JSON 0.3.3 yarl 1.6.3 zipp 3.4.0

lcyh commented 3 years ago

when I run : pip uninstall werkzeug pip install werkzeug==0.16.0

But it also does not work;

flask.cli.NoAppException flask.cli.NoAppException: While importing "app", an ImportError was raised:

Traceback (most recent call last): File "/Users/luochang/Desktop/project/game_report_platform/venv/lib/python3.7/site-packages/flask/cli.py", line 240, in locate_app import(module_name) File "/Users/luochang/Desktop/project/game_report_platform/app.py", line 1, in from superset import app File "/Users/luochang/Desktop/project/game_report_platform/superset/init.py", line 35, in from superset import config File "/Users/luochang/Desktop/project/game_report_platform/superset/config.py", line 29, in import redis ModuleNotFoundError: No module named 'redis'

please help me as soon as !

rayluo commented 3 years ago

File "/Users/luochang/Desktop/project/game_report_platform/app.py", line 1, in from superset import app File "/Users/luochang/Desktop/project/game_report_platform/superset/init.py", line 32, in from werkzeug.contrib.fixers import ProxyFix ModuleNotFoundError: No module named 'werkzeug.contrib'

This is the problem:

Well, this is the problem, your code snippet above was NOT part of our sample code

Please give me a plan as soon as possible

Plan:

  1. Clone or download this web app sample as-is
  2. Follow its README.md to run pip install -r requirements.txt to install its dependency
  3. Try to reproduce your issue