Flask ImportError: No Module Named Flask in python script

We got into the Flask ImportError issue when we were trying to run a python application from the command line. The error clearly stated that the Flask module is missing. This is the error we got:

Traceback (most recent call last):
  File "./run.py", line 3, in 
    from app import app
    from flask import Flask
ImportError: No module named flask

In our case, we were already running python3 for our project and it was missing the Flask module. We had to install the Flask module into our project. Following is the command that we had to run to solve the issue:

$ pip3 install flask
// pip is the python package manager

If the above approach does not work please look into this StackOverflow article:
Flask ImportError: No Module Named Flask

Share