Skip to main content

Virtual Environment (Windows)

Create Virtual Environment​

First, we will create a virtual environment to install all the dependencies.

  1. Create a folder where you will have your files.
  2. Open the folder in VS Code.
  3. Create a new terminal window; the terminal should automatically open in your root folder.
  4. Create the virtual environment (the last venv is the folder name, you can change it if you like):
    python -m venv venv
  5. 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.