Using virtualenvwrapper on windows

Anand Suthar
Nov 9, 2020

--

System specifications:

  • OS: Windows 10 Pro Version 1903 64bit
  • python: Version 3.8.6
  • pip: Version 20.2.4

Installation:

# using pip
pip install virtualenvwrapper-win
# using easy_install
easy_install virtualenvwrapper-win
# from source
git clone git://github.com/davidmarble/virtualenvwrapper-win.git
cd virtualenvwrapper-win
python setup.py install # or pip install .

Useful commands:

# create a virtual env named bob
mkvirtualenv bob
# specifying requirements file while creating env
mkvirtualenv -r path-to-requirements\requirements.txt bob
# deactivate activated env
deactivate
# activate env
workon bob
# delete virtual env named bob
rmvirtualenv bob
# list existing virtual envs
lsvirtualenv

Adding environment variables:

# move to the env dir
cdvirtualenv
# move to Scripts dir
cd Scripts
# open activate.bat in your favourite editor (I am using VS Code)
code activate.bat

Now move to the end of the file in the editor and specify your variables like this: set "DEBUG=False"
Here DEBUG is variable name and False is the value.

That’s all folks. Hope this helped and thanks a lot for reading. Looking forward for improvements or inclusions needed if any.

--

--

Anand Suthar
0 Followers

Full Stack Developer trying to understand JavaScript and Python better