flask command not found

In this troubleshooting guide we learn how to fix flask command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

flask: command not found

or when using sudo you get the following error message

sudo: flask: command not found

Solutions to flask: command not found

How To Fix flask: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu flask is provided by python3-flask package.

python3-flask is:

Flask is a micro web framework for Python based on Werkzeug, Jinja 2 and good intentions. A minimal Flask application looks like that:

from flask import Flask app = Flask(name)

@app.route("/") def hello(): return “Hello World!”

if name == ‘main’: app.run()

This package contains the Python 3.x module.

To fix this problem, we can install more using the command below.

sudo apt-get -y install python3-flask

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install python3-flask.

sudo apt -y install python3-flask

Or if you have aptitude installed you can use the following command.

sudo aptitude install python3-flask

Summary

In this tutorial we learn how to fix flask command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.