4
Summary: Virtual Python Environment builder
5
Home-page: http://www.virtualenv.org
6
Author: Jannis Leidel, Carl Meyer and Brian Rosner
7
Author-email: python-virtualenv@groups.google.com
14
You can install virtualenv with ``pip install virtualenv``, or the `latest
15
development version <https://github.com/pypa/virtualenv/tarball/develop#egg=virtualenv-dev>`_
16
with ``pip install virtualenv==dev``.
18
You can also use ``easy_install``, or if you have no Python package manager
19
available at all, you can just grab the single file `virtualenv.py`_ and run
20
it with ``python virtualenv.py``.
22
.. _virtualenv.py: https://raw.github.com/pypa/virtualenv/master/virtualenv.py
27
``virtualenv`` is a tool to create isolated Python environments.
29
The basic problem being addressed is one of dependencies and versions,
30
and indirectly permissions. Imagine you have an application that
31
needs version 1 of LibFoo, but another application requires version
32
2. How can you use both these applications? If you install
33
everything into ``/usr/lib/python2.7/site-packages`` (or whatever your
34
platform's standard location is), it's easy to end up in a situation
35
where you unintentionally upgrade an application that shouldn't be
38
Or more generally, what if you want to install an application *and
39
leave it be*? If an application works, any change in its libraries or
40
the versions of those libraries can break the application.
42
Also, what if you can't install packages into the global
43
``site-packages`` directory? For instance, on a shared host.
45
In all these cases, ``virtualenv`` can help you. It creates an
46
environment that has its own installation directories, that doesn't
47
share libraries with other virtualenv environments (and optionally
48
doesn't access the globally installed libraries either).
52
$ python virtualenv.py ENV
54
If you install it you can also just do ``virtualenv ENV``.
56
This creates ``ENV/lib/pythonX.X/site-packages``, where any libraries you
57
install will go. It also creates ``ENV/bin/python``, which is a Python
58
interpreter that uses this environment. Anytime you use that interpreter
59
(including when a script has ``#!/path/to/ENV/bin/python`` in it) the libraries
60
in that environment will be used.
62
It also installs either `Setuptools
63
<http://peak.telecommunity.com/DevCenter/setuptools>`_ or `distribute
64
<http://pypi.python.org/pypi/distribute>`_ into the environment. To use
65
Distribute instead of setuptools, just call virtualenv like this::
67
$ python virtualenv.py --distribute ENV
69
You can also set the environment variable VIRTUALENV_USE_DISTRIBUTE.
71
A new virtualenv also includes the `pip <http://pypy.python.org/pypi/pip>`_
72
installer, so you can use ``ENV/bin/pip`` to install additional packages into
75
Environment variables and configuration files
76
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78
virtualenv can not only be configured by passing command line options such as
79
``--distribute`` but also by two other means:
81
- Environment variables
83
Each command line option is automatically used to look for environment
84
variables with the name format ``VIRTUALENV_<UPPER_NAME>``. That means
85
the name of the command line options are capitalized and have dashes
86
(``'-'``) replaced with underscores (``'_'``).
88
For example, to automatically install Distribute instead of setuptools
89
you can also set an environment variable::
91
$ export VIRTUALENV_USE_DISTRIBUTE=true
92
$ python virtualenv.py ENV
94
It's the same as passing the option to virtualenv directly::
96
$ python virtualenv.py --distribute ENV
98
This also works for appending command line options, like ``--find-links``.
99
Just leave an empty space between the passsed values, e.g.::
101
$ export VIRTUALENV_EXTRA_SEARCH_DIR="/path/to/dists /path/to/other/dists"
104
is the same as calling::
106
$ python virtualenv.py --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV
110
virtualenv also looks for a standard ini config file. On Unix and Mac OS X
111
that's ``$HOME/.virtualenv/virtualenv.ini`` and on Windows, it's
112
``%HOME%\\virtualenv\\virtualenv.ini``.
114
The names of the settings are derived from the long command line option,
115
e.g. the option ``--distribute`` would look like this::
120
Appending options like ``--extra-search-dir`` can be written on multiple
128
Please have a look at the output of ``virtualenv --help`` for a full list
129
of supported options.
134
Some paths within the virtualenv are slightly different on Windows: scripts and
135
executables on Windows go in ``ENV\Scripts\`` instead of ``ENV/bin/`` and
136
libraries go in ``ENV\Lib\`` rather than ``ENV/lib/``.
138
To create a virtualenv under a path with spaces in it on Windows, you'll need
139
the `win32api <http://sourceforge.net/projects/pywin32/>`_ library installed.
144
Beginning with virtualenv version 1.5 `PyPy <http://pypy.org>`_ is
145
supported. To use PyPy 1.4 or 1.4.1, you need a version of virtualenv >= 1.5.
146
To use PyPy 1.5, you need a version of virtualenv >= 1.6.1.
148
Creating Your Own Bootstrap Scripts
149
-----------------------------------
151
While this creates an environment, it doesn't put anything into the
152
environment. Developers may find it useful to distribute a script
153
that sets up a particular environment, for example a script that
154
installs a particular web application.
156
To create a script like this, call
157
``virtualenv.create_bootstrap_script(extra_text)``, and write the
158
result to your new bootstrapping script. Here's the documentation
161
Creates a bootstrap script, which is like this script but with
162
extend_parser, adjust_options, and after_install hooks.
164
This returns a string that (written to disk of course) can be used
165
as a bootstrap script with your own customizations. The script
166
will be the standard virtualenv.py script, with your extra text
167
added (your extra text should be Python code).
169
If you include these functions, they will be called:
171
``extend_parser(optparse_parser)``:
172
You can add or remove options from the parser here.
174
``adjust_options(options, args)``:
175
You can change options here, or change the args (if you accept
176
different kinds of arguments, be sure you modify ``args`` so it is
177
only ``[DEST_DIR]``).
179
``after_install(options, home_dir)``:
181
After everything is installed, this function is called. This
182
is probably the function you are most likely to use. An
185
def after_install(options, home_dir):
186
if sys.platform == 'win32':
190
subprocess.call([join(home_dir, bin, 'easy_install'),
192
subprocess.call([join(home_dir, bin, 'my-package-script'),
195
This example immediately installs a package, and runs a setup
196
script from that package.
201
Here's a more concrete example of how you could use this::
203
import virtualenv, textwrap
204
output = virtualenv.create_bootstrap_script(textwrap.dedent("""
205
import os, subprocess
206
def after_install(options, home_dir):
207
etc = join(home_dir, 'etc')
208
if not os.path.exists(etc):
210
subprocess.call([join(home_dir, 'bin', 'easy_install'),
212
subprocess.call([join(home_dir, 'bin', 'paster'),
213
'make-config', 'BlogApplication',
214
join(etc, 'blog.ini')])
215
subprocess.call([join(home_dir, 'bin', 'paster'),
216
'setup-app', join(etc, 'blog.ini')])
218
f = open('blog-bootstrap.py', 'w').write(output)
220
Another example is available `here
221
<https://github.com/socialplanning/fassembler/blob/master/fassembler/create-venv-script.py>`_.
226
In a newly created virtualenv there will be a ``bin/activate`` shell
227
script. For Windows systems, activation scripts are provided for CMD.exe
230
On Posix systems you can do::
232
$ source bin/activate
234
This will change your ``$PATH`` to point to the virtualenv's ``bin/``
235
directory. (You have to use ``source`` because it changes your shell
236
environment in-place.) This is all it does; it's purely a convenience. If
237
you directly run a script or the python interpreter from the virtualenv's
238
``bin/`` directory (e.g. ``path/to/env/bin/pip`` or
239
``/path/to/env/bin/python script.py``) there's no need for activation.
241
After activating an environment you can use the function ``deactivate`` to
242
undo the changes to your ``$PATH``.
244
The ``activate`` script will also modify your shell prompt to indicate
245
which environment is currently active. You can disable this behavior,
246
which can be useful if you have your own custom prompt that already
247
displays the active environment name. To do so, set the
248
``VIRTUAL_ENV_DISABLE_PROMPT`` environment variable to any non-empty
249
value before running the ``activate`` script.
251
On Windows you just do::
253
> \path\to\env\Scripts\activate
255
And type `deactivate` to undo the changes.
257
Based on your active shell (CMD.exe or Powershell.exe), Windows will use
258
either activate.bat or activate.ps1 (as appropriate) to activate the
259
virtual environment. If using Powershell, see the notes about code signing
264
If using Powershell, the ``activate`` script is subject to the
265
`execution policies`_ on the system. By default on Windows 7, the system's
266
excution policy is set to ``Restricted``, meaning no scripts like the
267
``activate`` script are allowed to be executed. But that can't stop us
268
from changing that slightly to allow it to be executed.
270
In order to use the script, you have to relax your system's execution
271
policy to ``AllSigned``, meaning all scripts on the system must be
272
digitally signed to be executed. Since the virtualenv activation
273
script is signed by one of the authors (Jannis Leidel) this level of
274
the execution policy suffices. As an adminstrator run::
276
PS C:\> Set-ExecutionPolicy AllSigned
278
Then you'll be asked to trust the signer, when executing the script.
279
You will be prompted with the following::
281
PS C:\> virtualenv .\foo
282
New python executable in C:\foo\Scripts\python.exe
283
Installing setuptools................done.
284
Installing pip...................done.
285
PS C:\> .\foo\scripts\activate
287
Do you want to run software from this untrusted publisher?
288
File C:\foo\scripts\activate.ps1 is published by E=jannis@leidel.info,
289
CN=Jannis Leidel, L=Berlin, S=Berlin, C=DE, Description=581796-Gh7xfJxkxQSIO4E0
290
and is not trusted on your system. Only run scripts from trusted publishers.
291
[V] Never run [D] Do not run [R] Run once [A] Always run [?] Help
295
If you select ``[A] Always Run``, the certificate will be added to the
296
Trusted Publishers of your user account, and will be trusted in this
297
user's context henceforth. If you select ``[R] Run Once``, the script will
298
be run, but you will be prometed on a subsequent invocation. Advanced users
299
can add the signer's certificate to the Trusted Publishers of the Computer
300
account to apply to all users (though this technique is out of scope of this
303
Alternatively, you may relax the system execution policy to allow running
304
of local scripts without verifying the code signature using the following::
306
PS C:\> Set-ExecutionPolicy RemoteSigned
308
Since the ``activate.ps1`` script is generated locally for each virtualenv,
309
it is not considered a remote script and can then be executed.
311
.. _`execution policies`: http://technet.microsoft.com/en-us/library/dd347641.aspx
313
The ``--system-site-packages`` Option
314
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
316
If you build with ``virtualenv --system-site-packages ENV``, your virtual
317
environment will inherit packages from ``/usr/lib/python2.7/site-packages``
318
(or wherever your global site-packages directory is).
320
This can be used if you have control over the global site-packages directory,
321
and you want to depend on the packages there. If you want isolation from the
322
global system, do not use this flag.
324
Using Virtualenv without ``bin/python``
325
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
327
Sometimes you can't or don't want to use the Python interpreter
328
created by the virtualenv. For instance, in a `mod_python
329
<http://www.modpython.org/>`_ or `mod_wsgi <http://www.modwsgi.org/>`_
330
environment, there is only one interpreter.
332
Luckily, it's easy. You must use the custom Python interpreter to
333
*install* libraries. But to *use* libraries, you just have to be sure
334
the path is correct. A script is available to correct the path. You
335
can setup the environment like::
337
activate_this = '/path/to/env/bin/activate_this.py'
338
execfile(activate_this, dict(__file__=activate_this))
340
This will change ``sys.path`` and even change ``sys.prefix``, but also allow
341
you to use an existing interpreter. Items in your environment will show up
342
first on ``sys.path``, before global items. However, global items will
343
always be accessible (as if the ``--system-site-packages`` flag had been used
344
in creating the environment, whether it was or not). Also, this cannot undo
345
the activation of other environments, or modules that have been imported.
346
You shouldn't try to, for instance, activate an environment before a web
347
request; you should activate *one* environment as early as possible, and not
348
do it again in that process.
350
Making Environments Relocatable
351
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
353
Note: this option is somewhat experimental, and there are probably
354
caveats that have not yet been identified. Also this does not
355
currently work on Windows.
357
Normally environments are tied to a specific path. That means that
358
you cannot move an environment around or copy it to another computer.
359
You can fix up an environment to make it relocatable with the
362
$ virtualenv --relocatable ENV
364
This will make some of the files created by setuptools or distribute
365
use relative paths, and will change all the scripts to use ``activate_this.py``
366
instead of using the location of the Python interpreter to select the
369
**Note:** you must run this after you've installed *any* packages into
370
the environment. If you make an environment relocatable, then
371
install a new package, you must run ``virtualenv --relocatable``
374
Also, this **does not make your packages cross-platform**. You can
375
move the directory around, but it can only be used on other similar
376
computers. Some known environmental differences that can cause
377
incompatibilities: a different version of Python, when one platform
378
uses UCS2 for its internal unicode representation and another uses
379
UCS4 (a compile-time option), obvious platform changes like Windows
380
vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C
381
libraries on the system, if those C libraries are located somewhere
382
different (either different versions, or a different filesystem
385
If you use this flag to create an environment, currently, the
386
``--system-site-packages`` option will be implied.
388
The ``--extra-search-dir`` Option
389
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
391
When it creates a new environment, virtualenv installs either
392
setuptools or distribute, and pip. In normal operation, the latest
393
releases of these packages are fetched from the `Python Package Index
394
<http://pypi.python.org>`_ (PyPI). In some circumstances, this
395
behavior may not be wanted, for example if you are using virtualenv
396
during a deployment and do not want to depend on Internet access and
399
As an alternative, you can provide your own versions of setuptools,
400
distribute and/or pip on the filesystem, and tell virtualenv to use
401
those distributions instead of downloading them from the Internet. To
402
use this feature, pass one or more ``--extra-search-dir`` options to
403
virtualenv like this::
405
$ virtualenv --extra-search-dir=/path/to/distributions ENV
407
The ``/path/to/distributions`` path should point to a directory that
408
contains setuptools, distribute and/or pip distributions. Setuptools
409
distributions must be ``.egg`` files; distribute and pip distributions
410
should be `.tar.gz` source distributions.
412
Virtualenv will still download these packages if no satisfactory local
413
distributions are found.
415
If you are really concerned about virtualenv fetching these packages
416
from the Internet and want to ensure that it never will, you can also
417
provide an option ``--never-download`` like so::
419
$ virtualenv --extra-search-dir=/path/to/distributions --never-download ENV
421
If this option is provided, virtualenv will never try to download
422
setuptools/distribute or pip. Instead, it will exit with status code 1
423
if it fails to find local distributions for any of these required
424
packages. The local distribution lookup is done in this order and the
427
#. The current directory.
428
#. The directory where virtualenv.py is located.
429
#. A ``virtualenv_support`` directory relative to the directory where
430
virtualenv.py is located.
431
#. If the file being executed is not named virtualenv.py (i.e. is a boot
432
script), a ``virtualenv_support`` directory relative to wherever
433
virtualenv.py is actually installed.
435
Compare & Contrast with Alternatives
436
------------------------------------
438
There are several alternatives that create isolated environments:
440
* ``workingenv`` (which I do not suggest you use anymore) is the
441
predecessor to this library. It used the main Python interpreter,
442
but relied on setting ``$PYTHONPATH`` to activate the environment.
443
This causes problems when running Python scripts that aren't part of
444
the environment (e.g., a globally installed ``hg`` or ``bzr``). It
445
also conflicted a lot with Setuptools.
448
<http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_
449
is also a predecessor to this library. It uses only symlinks, so it
450
couldn't work on Windows. It also symlinks over the *entire*
451
standard library and global ``site-packages``. As a result, it
452
won't see new additions to the global ``site-packages``.
454
This script only symlinks a small portion of the standard library
455
into the environment, and so on Windows it is feasible to simply
456
copy these files over. Also, it creates a new/empty
457
``site-packages`` and also adds the global ``site-packages`` to the
458
path, so updates are tracked separately. This script also installs
459
Setuptools automatically, saving a step and avoiding the need for
462
* `zc.buildout <http://pypi.python.org/pypi/zc.buildout>`_ doesn't
463
create an isolated Python environment in the same style, but
464
achieves similar results through a declarative config file that sets
465
up scripts with very particular packages. As a declarative system,
466
it is somewhat easier to repeat and manage, but more difficult to
467
experiment with. ``zc.buildout`` includes the ability to setup
468
non-Python systems (e.g., a database server or an Apache instance).
470
I *strongly* recommend anyone doing application development or
471
deployment use one of these tools.
476
Refer to the `contributing to pip`_ documentation - it applies equally to
479
Virtualenv's release schedule is tied to pip's -- each time there's a new pip
480
release, there will be a new virtualenv release that bundles the new version of
483
.. _contributing to pip: http://www.pip-installer.org/en/latest/contributing.html
488
Virtualenv's test suite is small and not yet at all comprehensive, but we aim
491
The easy way to run tests (handles test dependencies automatically)::
493
$ python setup.py test
495
If you want to run only a selection of the tests, you'll need to run them
496
directly with nose instead. Create a virtualenv, and install required
499
$ pip install nose mock
505
Or select just a single test file to run::
507
$ nosetests tests.test_virtualenv
510
Other Documentation and Links
511
-----------------------------
513
* James Gardner has written a tutorial on using `virtualenv with
515
<http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox>`_.
518
<http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/>`_.
520
* Doug Hellmann wrote a description of his `command-line work flow
521
using virtualenv (virtualenvwrapper)
522
<http://www.doughellmann.com/articles/CompletelyDifferent-2008-05-virtualenvwrapper/index.html>`_
523
including some handy scripts to make working with multiple
524
environments easier. He also wrote `an example of using virtualenv
526
<http://www.doughellmann.com/articles/CompletelyDifferent-2008-02-ipython-and-virtualenv/index.html>`_.
528
* Chris Perkins created a `showmedo video including virtualenv
529
<http://showmedo.com/videos/video?name=2910000&fromSeriesID=291>`_.
531
* `Using virtualenv with mod_wsgi
532
<http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
534
* `virtualenv commands
535
<http://thisismedium.com/tech/extending-virtualenv/>`_ for some more
536
workflow-related tools around virtualenv.
541
``virtualenv`` is a successor to `workingenv
542
<http://cheeseshop.python.org/pypi/workingenv.py>`_, and an extension
544
<http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_.
546
It was written by Ian Bicking, sponsored by the `Open Planning
547
Project <http://openplans.org>`_ and is now maintained by a
548
`group of developers <https://github.com/pypa/virtualenv/raw/master/AUTHORS.txt>`_.
549
It is licensed under an
550
`MIT-style permissive license <https://github.com/pypa/virtualenv/raw/master/LICENSE.txt>`_.
558
* Fixed minor issue in `--relocatable`. Thanks, Cap Petschulat.
563
* Bumped the version string in ``virtualenv.py`` up, too.
565
* Fixed rST rendering bug of long description.
570
* Update embedded pip to version 1.1.
572
* Fix `--relocatable` under Python 3. Thanks Doug Hellmann.
574
* Added environ PATH modification to activate_this.py. Thanks Doug
575
Napoleone. Fixes #14.
577
* Support creating virtualenvs directly from a Python build directory on
578
Windows. Thanks CBWhiz. Fixes #139.
580
* Use non-recursive symlinks to fix things up for posix_local install
581
scheme. Thanks michr.
583
* Made activate script available for use with msys and cygwin on Windows.
584
Thanks Greg Haskins, Cliff Xuan, Jonathan Griffin and Doug Napoleone.
587
* Fixed creation of virtualenvs on Windows when Python is not installed for
588
all users. Thanks Anatoly Techtonik for report and patch and Doug
589
Napoleone for testing and confirmation. Fixes #87.
591
* Fixed creation of virtualenvs using -p in installs where some modules
592
that ought to be in the standard library (e.g. `readline`) are actually
593
installed in `site-packages` next to `virtualenv.py`. Thanks Greg Haskins
594
for report and fix. Fixes #167.
596
* Added activation script for Powershell (signed by Jannis Leidel). Many
597
thanks to Jason R. Coombs.
602
* Gave user-provided ``--extra-search-dir`` priority over default dirs for
603
finding setuptools/distribute (it already had priority for finding pip).
606
* Updated embedded Distribute release to 0.6.24. Thanks Alex Gronholm.
608
* Made ``--no-site-packages`` behavior the default behavior. The
609
``--no-site-packages`` flag is still permitted, but displays a warning when
610
used. Thanks Chris McDonough.
612
* New flag: ``--system-site-packages``; this flag should be passed to get the
613
previous default global-site-package-including behavior back.
615
* Added ability to set command options as environment variables and options
616
in a ``virtualenv.ini`` file.
618
* Fixed various encoding related issues with paths. Thanks Gunnlaugur Thor Briem.
620
* Made ``virtualenv.py`` script executable.
625
* Restored ability to run on Python 2.4, too.
630
* Restored ability to run on Python < 2.7.
635
* Updated embedded distribute release to 0.6.19.
637
* Updated embedded pip release to 1.0.2.
639
* Fixed #141 - Be smarter about finding pkg_resources when using the
640
non-default Python intepreter (by using the ``-p`` option).
642
* Fixed #112 - Fixed path in docs.
644
* Fixed #109 - Corrected doctests of a Logger method.
646
* Fixed #118 - Fixed creating virtualenvs on platforms that use the
647
"posix_local" install scheme, such as Ubuntu with Python 2.7.
649
* Add missing library to Python 3 virtualenvs (``_dummy_thread``).
655
* Start to use git-flow.
657
* Added support for PyPy 1.5
659
* Fixed #121 -- added sanity-checking of the -p argument. Thanks Paul Nasrat.
661
* Added progress meter for pip installation as well as setuptools. Thanks Ethan
664
* Added --never-download and --search-dir options. Thanks Ethan Jucovy.
669
* Added Python 3 support! Huge thanks to Vinay Sajip and Vitaly Babiy.
671
* Fixed creation of virtualenvs on Mac OS X when standard library modules
672
(readline) are installed outside the standard library.
674
* Updated bundled pip to 1.0.
679
* Moved main repository to Github: https://github.com/pypa/virtualenv
681
* Transferred primary maintenance from Ian to Jannis Leidel, Carl Meyer and Brian Rosner
683
* Fixed a few more pypy related bugs.
685
* Updated bundled pip to 0.8.2.
687
* Handed project over to new team of maintainers.
689
* Moved virtualenv to Github at https://github.com/pypa/virtualenv
694
* Added ``_weakrefset`` requirement for Python 2.7.1.
696
* Fixed Windows regression in 1.5
703
* Add support for PyPy.
705
* Uses a proper temporary dir when installing environment requirements.
707
* Add ``--prompt`` option to be able to override the default prompt prefix.
709
* Fix an issue with ``--relocatable`` on Windows.
711
* Fix issue with installing the wrong version of distribute.
713
* Add fish and csh activate scripts.
723
* Fix for Mac OS X Framework builds that use
724
``--universal-archs=intel``
726
* Fix ``activate_this.py`` on Windows.
728
* Allow ``$PYTHONHOME`` to be set, so long as you use ``source
729
bin/activate`` it will get unset; if you leave it set and do not
730
activate the environment it will still break the environment.
742
* Allow ``activate.sh`` to skip updating the prompt (by setting
743
``$VIRTUAL_ENV_DISABLE_PROMPT``).
750
* Fix ``activate.bat`` and ``deactivate.bat`` under Windows when
751
``PATH`` contained a parenthesis
756
* Include pip 0.6.2 and Distribute 0.6.10
758
* Create the ``virtualenv`` script even when Setuptools isn't
761
* Fix problem with ``virtualenv --relocate`` when ``bin/`` has
762
subdirectories (e.g., ``bin/.svn/``); from Alan Franzoni.
764
* If you set ``$VIRTUALENV_USE_DISTRIBUTE`` then virtualenv will use
765
Distribute by default (so you don't have to remember to use
776
* Fix pip installation on Windows
778
* Fix use of stand-alone ``virtualenv.py`` (and boot scripts)
780
* Exclude ~/.local (user site-packages) from environments when using
781
``--no-site-packages``
791
* Updated setuptools to 0.6c11
793
* Added the --distribute option
795
* Fixed packaging problem of support-files
800
* Virtualenv now copies the actual embedded Python binary on
801
Mac OS X to fix a hang on Snow Leopard (10.6).
803
* Fail more gracefully on Windows when ``win32api`` is not installed.
805
* Fix site-packages taking precedent over Jython's ``__classpath__``
806
and also specially handle the new ``__pyclasspath__`` entry in
809
* Now copies Jython's ``registry`` file to the virtualenv if it exists.
811
* Better find libraries when compiling extensions on Windows.
813
* Create ``Scripts\pythonw.exe`` on Windows.
815
* Added support for the Debian/Ubuntu
816
``/usr/lib/pythonX.Y/dist-packages`` directory.
818
* Set ``distutils.sysconfig.get_config_vars()['LIBDIR']`` (based on
819
``sys.real_prefix``) which is reported to help building on Windows.
821
* Make ``deactivate`` work on ksh
823
* Fixes for ``--python``: make it work with ``--relocatable`` and the
824
symlink created to the exact Python version.
829
* Use Windows newlines in ``activate.bat``, which has been reported to help
830
when using non-ASCII directory names.
832
* Fixed compatibility with Jython 2.5b1.
834
* Added a function ``virtualenv.install_python`` for more fine-grained
835
access to what ``virtualenv.create_environment`` does.
837
* Fix `a problem <https://bugs.launchpad.net/virtualenv/+bug/241581>`_
838
with Windows and paths that contain spaces.
840
* If ``/path/to/env/.pydistutils.cfg`` exists (or
841
``/path/to/env/pydistutils.cfg`` on Windows systems) then ignore
842
``~/.pydistutils.cfg`` and use that other file instead.
845
<https://bugs.launchpad.net/virtualenv/+bug/340050>`_ picking up
846
some ``.so`` libraries in ``/usr/local``.
851
* Remove the ``[install] prefix = ...`` setting from the virtualenv
852
``distutils.cfg`` -- this has been causing problems for a lot of
853
people, in rather obscure ways.
855
* If you use a `boot script <./index.html#boot-script>`_ it will attempt to import ``virtualenv``
856
and find a pre-downloaded Setuptools egg using that.
858
* Added platform-specific paths, like ``/usr/lib/pythonX.Y/plat-linux2``
863
* Real Python 2.6 compatibility. Backported the Python 2.6 updates to
864
``site.py``, including `user directories
865
<http://docs.python.org/dev/whatsnew/2.6.html#pep-370-per-user-site-packages-directory>`_
866
(this means older versions of Python will support user directories,
867
whether intended or not).
869
* Always set ``[install] prefix`` in ``distutils.cfg`` -- previously
870
on some platforms where a system-wide ``distutils.cfg`` was present
871
with a ``prefix`` setting, packages would be installed globally
872
(usually in ``/usr/local/lib/pythonX.Y/site-packages``).
874
* Sometimes Cygwin seems to leave ``.exe`` off ``sys.executable``; a
877
* Fix ``--python`` option.
879
* Fixed handling of Jython environments that use a
885
* Update to Setuptools 0.6c9
886
* Added an option ``virtualenv --relocatable EXISTING_ENV``, which
887
will make an existing environment "relocatable" -- the paths will
888
not be absolute in scripts, ``.egg-info`` and ``.pth`` files. This
889
may assist in building environments that can be moved and copied.
890
You have to run this *after* any new packages installed.
891
* Added ``bin/activate_this.py``, a file you can use like
892
``execfile("path_to/activate_this.py",
893
dict(__file__="path_to/activate_this.py"))`` -- this will activate
894
the environment in place, similar to what `the mod_wsgi example
895
does <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
896
* For Mac framework builds of Python, the site-packages directory
897
``/Library/Python/X.Y/site-packages`` is added to ``sys.path``, from
899
* Some platform-specific modules in Macs are added to the path now
900
(``plat-darwin/``, ``plat-mac/``, ``plat-mac/lib-scriptpackages``),
902
* Fixed a small Bashism in the ``bin/activate`` shell script.
903
* Added ``__future__`` to the list of required modules, for Python
904
2.3. You'll still need to backport your own ``subprocess`` module.
905
* Fixed the ``__classpath__`` entry in Jython's ``sys.path`` taking
906
precedent over virtualenv's libs.
911
* Added a ``--python`` option to select the Python interpreter.
912
* Add ``warnings`` to the modules copied over, for Python 2.6 support.
913
* Add ``sets`` to the module copied over for Python 2.3 (though Python
914
2.3 still probably doesn't work).
919
* Added support for Jython 2.5.
924
* Added support for Python 2.6.
925
* Fix a problem with missing ``DLLs/zlib.pyd`` on Windows. Create
926
* ``bin/python`` (or ``bin/python.exe``) even when you run virtualenv
927
with an interpreter named, e.g., ``python2.4``
928
* Fix MacPorts Python
929
* Added --unzip-setuptools option
930
* Update to Setuptools 0.6c8
931
* If the current directory is not writable, run ez_setup.py in ``/tmp``
932
* Copy or symlink over the ``include`` directory so that packages will
933
more consistently compile.
938
* Fix build on systems that use ``/usr/lib64``, distinct from
939
``/usr/lib`` (specifically CentOS x64).
940
* Fixed bug in ``--clear``.
941
* Fixed typos in ``deactivate.bat``.
942
* Preserve ``$PYTHONPATH`` when calling subprocesses.
947
* Fix include dir copying on Windows (makes compiling possible).
948
* Include the main ``lib-tk`` in the path.
949
* Patch ``distutils.sysconfig``: ``get_python_inc`` and
950
``get_python_lib`` to point to the global locations.
951
* Install ``distutils.cfg`` before Setuptools, so that system
952
customizations of ``distutils.cfg`` won't effect the installation.
953
* Add ``bin/pythonX.Y`` to the virtualenv (in addition to
955
* Fixed an issue with Mac Framework Python builds, and absolute paths
956
(from Ronald Oussoren).
961
* Improve ability to create a virtualenv from inside a virtualenv.
962
* Fix a little bug in ``bin/activate``.
963
* Actually get ``distutils.cfg`` to work reliably.
968
* Added ``lib-dynload`` and ``config`` to things that need to be
969
copied over in an environment.
970
* Copy over or symlink the ``include`` directory, so that you can
971
build packages that need the C headers.
972
* Include a ``distutils`` package, so you can locally update
973
``distutils.cfg`` (in ``lib/pythonX.Y/distutils/distutils.cfg``).
974
* Better avoid downloading Setuptools, and hitting PyPI on environment
976
* Fix a problem creating a ``lib64/`` directory.
977
* Should work on MacOSX Framework builds (the default Python
978
installations on Mac). Thanks to Ronald Oussoren.
983
* Windows installs would sometimes give errors about ``sys.prefix`` that
985
* Slightly prettier output.
990
* Added support for Windows.
995
* Give a better warning if you are on an unsupported platform (Mac
996
Framework Pythons, and Windows).
997
* Give error about running while inside a workingenv.
998
* Give better error message about Python 2.3.
1003
Fixed packaging of the library.
1008
Initial release. Everything is changed and new!
1010
Keywords: setuptools deployment installation distutils
1012
Classifier: Development Status :: 4 - Beta
1013
Classifier: Intended Audience :: Developers
1014
Classifier: License :: OSI Approved :: MIT License
1015
Classifier: Programming Language :: Python :: 2
1016
Classifier: Programming Language :: Python :: 2.4
1017
Classifier: Programming Language :: Python :: 2.5
1018
Classifier: Programming Language :: Python :: 2.6
1019
Classifier: Programming Language :: Python :: 2.7
1020
Classifier: Programming Language :: Python :: 3
1021
Classifier: Programming Language :: Python :: 3.1
1022
Classifier: Programming Language :: Python :: 3.2