Package: virtualenvwrapper-win
virtualenvwrapper-winThis is a port of Doug Hellmann’svirtualenvwrapperto Windows batch scripts. The idea behind virtualenvwrapper is to ease usage of
Ian Bicking’svirtualenv, a tool
for creating isolated Python virtual environments, each with their own libraries
and site-packages.These scripts should work on any version of Windows (Windows XP, Windows Vista, Windows 7/8/10).However, they only work in theregular command prompt. Theywill not work in Powershell.There are other virtualenvwrapper projects out there for Powershell.InstallationFor Windows onlyTo use these scripts from any directory, make sure theScriptssubdirectory of Python is in your PATH. For example, if python is installed inC:\Python27\, you should make sureC:\Python27\Scriptsis in your PATH.To install, run one of the following:# 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 .WORKON_HOME (Optional)Add an environment variable WORKON_HOME to specify the path to store environments.
By default, this is%USERPROFILE%\Envs.pywin (Optional)pywinpython version switcher (not included)If you use several versions of python, you can switch between them
using a separate projectpywin. It’s a lightweight
python 2.5-3.3 launcher and switcher I wrote for the Windows
command line and MSYS/MINGW32. It’s similar to thepy.exe
launcher/switcher available in python 3.3, but
written with basic Windows batch scripts and a shell script for
MSYS/MINGW32 support. I use bash and command line shell tools frommsysgit, based on MSYS/MINGW32, to
do most of my python development on Windows.Main Commandsmkvirtualenv[mkvirtualenv-options][virtualenv-options]<name>Create a new virtualenv environment named<name>.  The environment will
be created in WORKON_HOME.mkvirtualenvoptions:-hPrint help text.-aproject_pathAssociate existing path as project directory-ipackageInstall package in new environment. This option
can be repeated to install more than one package.-rrequirements_filerequirements_file is passed to
pip install -r requirements_fileany other options are passed on to thevirtualenvcommand.
For recent versions ofvirtualenv, the-p/--pythoncan take version numbers instead of the full path to the interpreter,
e.g.mkvirtualenv-p3.5<name>(assuming you have a Python 3.5.x
interpreter installed).lsvirtualenvList all of the enviornments stored in WORKON_HOME.rmvirtualenv <name>Remove the environment<name>.workon [<name>]If<name>is specified, activate the environment named<name>(change
the working virtualenv to<name>). If a project directory has been
defined, we will change into it. If no argument is specified, list the
available environments. One can pass additional option -c after
virtualenv name to cd to virtualenv directory if no projectdir is set.deactivateDeactivate the working virtualenv and switch back to the default system
Python.add2virtualenv <full or relative path>If a virtualenv environment is active, appends<path>tovirtualenv_path_extensions.pthinside the environment’s site-packages,
which effectively adds<path>to the environment’s PYTHONPATH.
If a virtualenv environment is not active, appends<path>tovirtualenv_path_extensions.pthinside the default Python’s
site-packages. If<path>doesn’t exist, it will be created.Convenience CommandscdprojectIf a virtualenv environment is active and a projectdir has been defined,
change the current working directory to active virtualenv’s project directory.cd-will return you to the last directory you were in before callingcdproject.cdsitepackagesIf a virtualenv environment is active, change the current working
directory to the active virtualenv’s site-packages directory. If
a virtualenv environment is not active, change the current working
directory to the default Python’s site-packages directory.cd-will return you to the last directory you were in before callingcdsitepackages.cdvirtualenvIf a virtualenv environment is active, change the current working
directory to the active virtualenv base directory. If a virtualenv
environment is not active, change the current working directory to
the base directory of the default Python.cd-will return you
to the last directory you were in before callingcdvirtualenv.lssitepackagesIf a virtualenv environment is active, list that environment’s
site-packages. If a virtualenv environment is not active, list the
default Python’s site-packages. Output includes a basic listing of
the site-packages directory, the contents of easy-install.pth,
and the contents of virtualenv_path_extensions.pth (used byadd2virtualenv).mkprojectIf the environment variable PROJECT_HOME is set, create a new project
directory in PROJECT_HOME and a virtualenv in WORKON_HOME.  The project path
will automatically be associated with the virtualenv on creation.setprojectdir <full or relative path>If a virtualenv environment is active, define<path>as project
directory containing the source code.  This allows the use ofcdprojectto change the working directory. In addition, the directory will be
added to the environment usingadd2virtualenv. If<path>doesn’t
exist, it will be created.toggleglobalsitepackagesIf a virtualenv environment is active, toggle between having the
global site-packages in the PYTHONPATH or just the virtualenv’s
site-packages.whereis <file>A script included for convenience. Returns the locations (on%PATH%)
that contain an executablefile. You can callwhereis pythonto find all executables starting withpythonorwhereis python.exefor an exact match.virtualenvwrapperPrint a list of commands and their descriptions as basic help output.
(added in v.1.2.4)HooksTo run some commands aftermkvirtualenvyou can use hooks. First
you need to defineVIRTUALENVWRAPPER_HOOK_DIRvariable. If it is
setmkvirtualenvwill runpostmkvirtualenv.batscript from
that directory.ChangesVersion <next>Version 1.2.5Bugfix release.Version 1.2.4Fixed problems with spaces in workon, rmvirtualenv, mkproject, mkvirtualenv -a
when the virtualenv name or project directory contained spaces (#89). @thebjornFixed problems with spaces etc. in add2virtualenv and setprojectdir (#92, #93) @thebjornAdded mkproject convenience script (@thehug0naut)folder_delete.bat is deprecated and will be removed in a future version.
You should be usingrmdir %dirname% /s /qinstead.Version 1.2.3Fixed a problem when the WORKON_HOME folder contained spaces.Fixed a bug where cmd.com couldn’t pass the Python executable to virtualenv
if the path included the drive letter.Improved publish pipeline.Version 1.2.2-a, -i, and -r options are now available (@thebjorn)added rudimentary test-suite (@thebjorn)fixrmvirtualenvcommand which didn’t delete directory when
e.g. pip left extra files (@rcutmore)Version 1.2.1scripts are now left in Scripts directory (@adamc55)Version 1.2.0 (16-03-2015)Thanks to Christian Long (@christianmlong)
*mkvirtualenvhooks