From c81df96cb2efe3ed3bf3cec1e89e3799827aeeff Mon Sep 17 00:00:00 2001 From: Himesh Verma Date: Thu, 26 Feb 2026 16:30:20 +0530 Subject: [PATCH] Improve setup docs and add matplotlib dependency (fix #29) --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++------ requirements.txt | 2 ++ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7d78a976..ff26fc5f 100644 --- a/README.md +++ b/README.md @@ -12,27 +12,34 @@ The project consists of two parts, this repository contains the backend of the a - [Python 3x](https://www.python.org/downloads/) -## Setting Up a Virtual Environment +## 🔧 Setting Up a Virtual Environment +Before installing dependencies and running the Flask server, it is recommended to create and activate a Python virtual environment to isolate project dependencies. + +--- + +### 🐧 Linux & macOS + +#### Step 1: Create a virtual environment -#### **Linux & macOS** -##### **Step 1: Create a virtual environment** ```sh python3 -m venv venv ``` - ##### **Step 2: Activate the virtual environment** + ```sh source venv/bin/activate ``` ##### **Step 3: Install dependencies** + ```sh pip install -r requirements.txt ``` ##### **Step 4: Run Flask** + ```sh flask run ``` @@ -40,22 +47,49 @@ flask run --- #### **Windows** + ##### **Step 1: Create a virtual environment** + ```sh python -m venv venv ``` ##### **Step 2: Activate the virtual environment** + +**PowerShell / CMD** + ```sh venv\Scripts\activate ``` +**Git Bash** + +```sh +source venv/Scripts/activate +``` + +**If activation is blocked in PowerShell, run:** + +```sh +Set-ExecutionPolicy Unrestricted -Scope Process +``` + ##### **Step 3: Install dependencies** + ```sh pip install -r requirements.txt ``` +- All required dependencies are installed using `requirements.txt`. + +- If you encounter missing modules, install them manually using pip. + +```sh +pip install matplotlib +``` + ##### **Step 4: Run Flask** + ```sh flask run ``` @@ -65,37 +99,43 @@ flask run ### **2. Using Conda (Works on Linux, macOS, and Windows)** #### **Step 1: Create a Conda virtual environment** + ```sh conda create --name flask_env python=3.10 ``` #### **Step 2: Activate the environment** + ```sh conda activate flask_env ``` #### **Step 3: Install dependencies** + ```sh pip install -r requirements.txt ``` #### **Step 4: Run Flask** + ```sh flask run ``` - ### **Additional Notes** + - If you face issues running `flask run`, try: ```sh python -m flask run ``` + - If Flask is not installed, install it manually: ```sh pip install flask ``` + - On **Windows**, if `venv\Scripts\activate` doesn't work, **run PowerShell as Administrator** and enable scripts: ```sh @@ -107,7 +147,6 @@ flask run Anyone is free to contribute to this project. Just do a pull request with your code and if it is all good we will accept it. You can also help us look for bugs if you find anything that creates an issue. To see the full list of contributions, check out the ahead commits of the "develop" branch concerning the "main" branch. Full logs of the project development can be found in the [Daily Work Progress](https://docs.google.com/document/d/1RjCnGjYYgPKvFUrN8hSjPX29aayWr6eEopeCN3QZwEQ/edit?usp=sharing) file. Hoping to see your name in the list of contributors soon! 🚀 - ## 📃 License This software is under the [MIT License](https://opensource.org/licenses/MIT). diff --git a/requirements.txt b/requirements.txt index 69429c32..b8605457 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,3 +18,5 @@ tzdata==2025.2 Werkzeug==3.1.3 gunicorn==23.0.0 requests==2.31.0 + +matplotlib \ No newline at end of file