• 9663920875
  • leo@leonardtopno.com
  • Bengaluru, India
Blog
How to install and create Virtual Environment in Windows

How to install and create Virtual Environment in Windows

Problem Statement: Installing virtual environment in Windows:

1. To install Virtual Environment, type the following in terminal:
Syntax: pip3 install virtualenv



C:\Users\leo>  pip3 install virtualenv 

You can check the version of the virtual environment installed by typing the following



C:\Users\leo>  virtualenv --version 

2. To create Virtual Environment navigate to the folder where you wish to create Virtual Environment and type:
Syntax: python -m virtualenv <name-of-the-virtual-environment>
or
virtualenv<name-of-the-virtual-environment>




C:\Users\leo\coding\utilities>  python -m virtualenv venv 

                            OR

C:\Users\leo\coding\utilities>  virtualenv venv



2. To Activate the Virtual Environment type [specific to Windows (Not for MacOS)]:
Syntax: .\<name-of-the-virtual-environment>\Scripts\activate.bat
or
.\<name-of-the-virtual-environment>\Scripts\activate



C:\Users\leo\coding\utilities>  .\venv\Scripts\activate.bat

                           OR

C:\Users\leo\coding\utilities>  .\venv\Scripts\activate

Share via
Copy link
Powered by Social Snap