Virtual Environment (Windows)
Create Virtual Environment
First, we will create a virtual environment to install all the dependencies.
- Create a folder where you will have your files.
- Open the folder in VS Code.
- Create a new terminal window; the terminal should automatically open in your root folder.
- Create the virtual environment (the last
venvis the folder name, you can change it if you like):python -m venv venv - Activate the environment. In Windows, use the following command. Once active, you should see
(venv)appear in the terminal:.\venv\Scripts\activate
Install Dependencies
To install all the dependencies, use the following command. It assumes that requirements.txt is in the root folder:
pip install -r requirements.txt
Ensure the following points are covered in your requirements.txt:
- The file should list all the necessary packages for your project.
- Each package should be on a new line.
This should help in creating and managing a virtual environment efficiently on Windows.