40
3.3 Living on the Edge
IfyouwanttoworkwiththelatestversionofFlask,therearetwoways: youcaneither
let pippull inthe developmentversion, or you can tell ittooperate onagitcheckout.
Either way,virtualenvisrecommended.
Getthe gitcheckoutinanewvirtualenvandrun indevelopment mode:
$ git clone http://github.com/mitsuhiko/flask.git
Initialized empty Git repository in ~/dev/flask/.git/
$ cd flask
$ virtualenv venv --distribute
New python executable in venv/bin/python
Installing distribute............done.
$ . venv/bin/activate
$ python setup.py develop
...
Finished processing dependencies for Flask
This will pull in the dependencies and activate the git head as the current version
inside the virtualenv. Thenall youhave todoisrungit pull origintoupdate tothe
latestversion.
Tojustgetthe developmentversionwithoutgit,dothisinstead:
$ mkdir flask
$ cd flask
$ virtualenv venv --distribute
$ . venv/bin/activate
New python executable in venv/bin/python
Installing distribute............done.
$ pip install Flask==dev
...
Finished processing dependencies for Flask==dev
3.4 pip and distribute on Windows
On Windows, installation of easy_install is a little bit trickier, but still quite easy. The
easiest waytodoitistodownloadthedistribute_setup.pyfile andrun it. The easiest
waytorunthefile istoopenyourdownloadsfolderanddouble-clickon the file.
Next, addthe easy_install commandandotherPython scripts tothe commandsearch
path, by adding your Python installation’s Scripts folder to the PATH environment
variable. To do that, right-click on the “Computer” icon on the Desktop or in the
Start menu, and choose “Properties”. Then click on “AdvancedSystem settings”(in
WindowsXP, clickon the “Advanced”tab instead). Then clickon the “Environment
variables” button. Finally, double-click on the “Path” variable in the “System vari-
ables”section,andaddthepathofyourPythoninterpreter’sScriptsfolder. Be sure to
9