Python VirtualEnv on Windows

December 31, 2014

I have a need to allow another developer to work on one of my projects, and he's on windows. I develop in Linux. Unfortunately, the setup on my machine has developed over the years, so it's not easy to replicate. There's a lesson there I'm sure!

Pip on Windows

To install pip, download it from https://bootstrap.pypa.io/get-pip.py and then run that .py file in python:

C:\Users\Tim\Downloads>python get-pip.py
Collecting pip  
  Downloading pip-6.0.6-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 682kB/s ta 0:00:01
Collecting setuptools
  Downloading setuptools-11.0-py2.py3-none-any.whl (498kB)
    100% |################################| 499kB 835kB/s ta 0:00:01
Installing collected packages: setuptools, pip

Successfully installed pip-6.0.6 setuptools-11.0
C:\Users\Tim\Downloads>

You can this add the scripts directory to the path using:

C:\Users\Tim\Downloads>python C:\Python27\Tools\Scripts\win_add2path.py

Path(s) added:
c:\python27
c:\python27\Scripts

Install VirtualEnv

Next, install virtual env using the following command:

C:\>pip install virtualenv
Collecting virtualenv
  Downloading virtualenv-12.0.5-py2.py3-none-any.whl (1.8MB)
    100% |################################| 1.8MB 706kB/s ta 0:00:01 
Installing collected packages: virtualenv

Successfully installed virtualenv-12.0.5

Tags: python pip setup tools