@@ -8,15 +8,22 @@ projects in separate places, by creating virtual Python environments for them.
88It solves the "Project X depends on version 1.x but, Project Y needs 4.x"
99dilemma, and keeps your global site-packages directory clean and manageable.
1010
11- For example, you can work on a project which requires Django 1.3 while also
12- maintaining a project which requires Django 1.0.
11+ For example, you can work on a project which requires Django 1.9 while also
12+ maintaining a project which requires Django 1.8.
13+
14+ If you are using Python 3, make sure you run something like the following (or
15+ have it in your env variables in `~/.bashrc `):
16+
17+ .. code-block :: console
18+
19+ $ export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
1320
1421 virtualenv
1522----------
1623
1724`virtualenv <http://pypi.python.org/pypi/virtualenv >`_ is a tool to create
18- isolated Python environments. virtualenv creates a folder which contains all the
19- necessary executables to use the packages that a Python project would need.
25+ isolated Python environments. virtualenv creates a folder which contains all the
26+ necessary executables to use the packages that a Python project would need.
2027
2128Install virtualenv via pip:
2229
@@ -43,23 +50,23 @@ in the current directory instead.
4350This creates a copy of Python in whichever directory you ran the command in,
4451placing it in a folder named :file: `venv `.
4552
46- You can also use a Python interpreter of your choice.
53+ You can also use the Python interpreter of your choice.
4754
4855.. code-block :: console
4956
50- $ virtualenv -p /usr/bin/python2.7 venv
57+ $ virtualenv -p /usr/local/ bin/python3 venv
5158
52- This will use the Python interpreter in :file: `/usr/bin/python2.7 `
59+ This will use the Python interpreter in :file: `/usr/local/ bin/python3 `
5360
54612. To begin using the virtual environment, it needs to be activated:
5562
5663.. code-block :: console
5764
5865 $ source venv/bin/activate
5966
60- The name of the current virtual environment will now appear on the left of
61- the prompt (e.g. ``(venv)Your-Computer:your_project UserName$) `` to let you know
62- that it's active. From now on, any package that you install using pip will be
67+ The name of the current virtual environment will now appear on the left of
68+ the prompt (e.g. ``(venv)Your-Computer:your_project UserName$) `` to let you know
69+ that it's active. From now on, any package that you install using pip will be
6370placed in the ``venv `` folder, isolated from the global Python installation.
6471
6572Install packages as usual, for example:
@@ -78,7 +85,7 @@ Install packages as usual, for example:
7885 This puts you back to the system's default Python interpreter with all its
7986installed libraries.
8087
81- To delete a virtual environment, just delete its folder. (In this case,
88+ To delete a virtual environment, just delete its folder. (In this case,
8289it would be ``rm -rf venv ``.)
8390
8491After a while, though, you might end up with a lot of virtual environments
@@ -102,8 +109,8 @@ the current state of the environment packages. To do this, run
102109
103110 This will create a :file: `requirements.txt ` file, which contains a simple
104111list of all the packages in the current environment, and their respective
105- versions. You can see the list of installed packages without the requirements
106- format using "pip list". Later it will be easier for a different developer
112+ versions. You can see the list of installed packages without the requirements
113+ format using "pip list". Later it will be easier for a different developer
107114(or you, if you need to re-create the environment) to install the same packages
108115using the same versions:
109116
@@ -143,7 +150,7 @@ To install (make sure **virtualenv** is already installed):
143150.. code-block :: console
144151
145152 $ pip install virtualenvwrapper-win
146-
153+
147154 In Windows, the default path for WORKON_HOME is %USERPROFILE%\E nvs
148155
149156Basic Usage
0 commit comments