Skip to content

Instantly share code, notes, and snippets.

@JudahSan
Created February 24, 2023 20:31
Show Gist options
  • Save JudahSan/c1bbddba378534dc4bfdad15229b315a to your computer and use it in GitHub Desktop.
Save JudahSan/c1bbddba378534dc4bfdad15229b315a to your computer and use it in GitHub Desktop.
Installing VirtualEnv on Windows
  1. Open Command Prompt or PowerShell in Windows.

  2. Install virtualenv by typing the following command:

pip install virtualenv

If you don't have pip installed, you can download it from the official website: https://pip.pypa.io/en/stable/installing/

  1. Once virtualenv is installed, navigate to the directory where you want to create your virtual environment.

  2. Create a new virtual environment by running the following command:

virtualenv env

This will create a new directory called env in your current directory, which will contain the virtual environment.

  1. Activate the virtual environment by running the following command:
.\env\Scripts\activate

If you're using PowerShell, you'll need to run .\env\Scripts\Activate.ps1 instead.

  1. When the virtual environment is activated, you should see its name in your command prompt or PowerShell prompt (e.g. (env) C:\path\to\directory>).

  2. You can now install packages and run Python scripts within the virtual environment.

  3. When you're done working in the virtual environment, you can deactivate it by running the following command:

deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment