0
0
Flaskframework~5 mins

Installing Flask

Choose your learning style9 modes available
Introduction

Flask is a tool that helps you build websites easily. Installing Flask lets you start making your own web apps on your computer.

You want to create a simple website or web app quickly.
You are learning how web servers work and want a friendly tool.
You need a small project that doesn't require a lot of setup.
You want to try out Python web programming for the first time.
Syntax
Flask
pip install Flask
Run this command in your computer's terminal or command prompt.
Make sure you have Python and pip installed before running this.
Examples
This installs the latest version of Flask globally on your system.
Flask
pip install Flask
This installs a specific version of Flask, useful if you want to match a tutorial or project requirement.
Flask
pip install Flask==2.3.2
This creates a separate space (virtual environment) for your project and installs Flask there, keeping things organized.
Flask
python -m venv myenv
source myenv/bin/activate  # On Windows use: myenv\Scripts\activate
pip install Flask
Sample Program

This small program shows the version of Flask installed, confirming the installation worked.

Flask
# After installing Flask, check the version
import flask
print(flask.__version__)
OutputSuccess
Important Notes

If you get an error saying 'pip' is not recognized, you may need to install Python or add it to your system path.

Using a virtual environment is a good habit to avoid conflicts between projects.

After installation, you can start building web apps by creating Python files that use Flask.

Summary

Flask is installed using the command pip install Flask.

Using virtual environments helps keep your projects clean and separate.

Check your Flask version with a simple Python script to confirm installation.