Skip to content

Latest commit

 

History

History
60 lines (51 loc) · 1.56 KB

File metadata and controls

60 lines (51 loc) · 1.56 KB

Installing Dependencies from requirements.txt

Prerequisites

  • Ensure you have Python installed. You can download it from python.org.
  • Ensure you have pip installed. It usually comes with Python, but you can check by running:
    python -m pip --version

Installation Steps

  1. Navigate to the Project Directory Open a terminal or command prompt and navigate to the directory where requirements.txt is located:

    cd /path/to/project
  2. Create a Virtual Environment (Optional but Recommended) It's best practice to install dependencies in a virtual environment to avoid conflicts:

    python -m venv venv

    Activate the virtual environment:

    • On Windows:
      venv\Scripts\activate
    • On macOS/Linux:
      source venv/bin/activate
  3. Install Dependencies Run the following command to install all dependencies listed in requirements.txt:

    pip install -r requirements.txt
  4. Verify Installation To check if the dependencies were installed correctly, run:

    pip list

Troubleshooting

  • If you encounter permission issues, try running:
    pip install --user -r requirements.txt
  • If installation fails due to outdated pip, upgrade it with:
    pip install --upgrade pip

Deactivating the Virtual Environment

If you used a virtual environment, you can deactivate it by running:

 deactivate