Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
VirtualEnv
Holger Dinkel, EPUG
Version 1.3, %%date(%d.%m.%Y)
%!include(html): SITEPATH/menu_t2t
+Installation+
Install PIP:
```
wget http://pypi.python.org/pypi/pip/1.1#downloads
tar xzf pip-1.1.tar.gz
cd pip-1.1
python setup.py install
```
Install virtualenv, virtualenvwrapper:
```
pip install virtualenv virtualenvwrapper
```
Show installed packages:
```
pip freeze
```
Use requirements files to install exactly the correct versions:
```
pip freeze > requirements.txt
pip install -r requirements.txt
```
read http://www.doughellmann.com/projects/virtualenvwrapper/
read http://virtualenvwrapper.readthedocs.org/en/latest/index.html
+Usage+
++VirtualenvWrapper++
Features:
+ Organizes all of your virtual environments in one place.
+ Wrappers for managing your virtual environments (create, delete, copy).
+ Use a single command to switch between environments.
+ Tab completion for commands that take a virtual environment as argument.
+ User-configurable hooks for all operations (see Per-User Customization).
+ Plugin system for more creating sharable extensions (see Extending Virtualenvwrapper).
Usage:
create directory to hold your environments:
```
mkdir $WORKON_HOME
```
Then create the Variable WORKON_HOME and source the wrapper script
(it's a good idea to put this into your bashrc):
```
export WORKON_HOME=~/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
```
create a new virtual environment:
```
mkvirtualenv test_environment
```
switch to an existing virtual environment:
```
workon test_envirnoment
```
stop using an environment:
```
deactivate
```
show all environments that exist in folder $WORKON_HOME:
```
lsvirtualenv
```
change into the directory of an environment:
```
cdvirtualenv <env>
```
You can go crazy on customizing the individual scripts for each environment:
in file WORKON_HOME/<ENV>/bin/postactivate
```
export OLD_VIRTUAL_ENV=$PWD
cd $VIRTUAL_ENV/bin
```
in file $WORKON_HOME/<ENV>/bin/postdeactivate
```
cd $OLD_VIRTUAL_ENV
```
%!include(html): SITEPATH/footer_t2t