- 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
-
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
-
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
- On Windows:
-
Install Dependencies Run the following command to install all dependencies listed in
requirements.txt
:pip install -r requirements.txt
-
Verify Installation To check if the dependencies were installed correctly, run:
pip list
- 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
If you used a virtual environment, you can deactivate it by running:
deactivate