Reputation: 63
I try the example on: https://github.com/Azure-Samples/ms-identity-python-webapp with Windows 10, but I get an error with ModuleNotFoundError: No module named 'flask_caching.backends.filesystem'
(Flask-Caching is already installed with pip).
Version: Python 3.9.9, Flask 1.1.4 and Werkzeug 1.0.1.
I only changed the code with Client_ID, CLient_Secret and domain name in app_config.py
.
Has anybody an idea?
Upvotes: 0
Views: 388
Reputation: 10831
The error ModuleNotFoundError means python interpreter cannot find the libraries which you are referring to in the code although the module is already installed.
Common causes of this error:
(Or)
If you are using a python virtual environment. It need to be installed after creating a virtual environment as commented by @grumpyp . The libraries will reside inside the folder created for the virtual environment. And can installed according to requirements.txt file
pip install virtualenv
It requires activation and dedicated installation of modules inside the virtual environment. Refer this blog for more details to do
pip install -r requirements.txt
Other reference :Set Up a Virtual Python Environment (Windows)
(or )
This may not be your query but Just to make it a bit easy You can try this way when trying out your sample project to compare with manually configured one.
The quick start: "Add sign-in with Microsoft to a Python web app" that you are using ,can be directly configured in portal quickstart like below where every thing is configured including client id ,tenant id etc directly.
There after following the steps , I checked the versions with pip freeze
and
versions i have: Python 3.9.7, Flask 1.1.4 and Werkzeug 1.0.1.
quickstart-v2-python-webapp | microsoftdocs
Upvotes: 1