• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 .. _tutorials.virtualenv:
2 
3 Installing virtualenv
4 =====================
5 `virtualenv <http://pypi.python.org/pypi/virtualenv>`_, sets a
6 "virtual environment" that allows you to run different projects with separate
7 libraries side by side. This is a good idea both for development and
8 production, as it'll assure that each project uses their own library versions
9 and don't affect each other.
10 
11 .. note::
12    For App Engine development, virtualenv is not necessary. The SDK provides
13    a "sandboxed environment" that serves almost the same purposes.
14 
15 If you don't have a package installer in your system yet (like ``pip`` or
16 ``easy_install``), install one. See :ref:`tutorials.installing.packages`.
17 
18 Then follow these steps to install virtualenv:
19 
20 **1.** To install it on a Linux or Mac systems, type in the command line:
21 
22 .. code-block:: text
23 
24    $ sudo pip install virtualenv
25 
26 Or, using easy_install:
27 
28 .. code-block:: text
29 
30    $ sudo easy_install virtualenv
31 
32 **2.** Then create a directory for your app, access it and setup a virtual
33 environment using the following command:
34 
35 .. code-block:: text
36 
37    $ virtualenv env
38 
39 **3.** Activate the environment. On Linux of Mac, use:
40 
41 .. code-block:: text
42 
43    $ . env/bin/activate
44 
45 Or on a Windows system:
46 
47 .. code-block:: text
48 
49    $ env\scripts\activate
50