Skip to content
Myr

Merge pull request #977 from Ivoz/patch-1

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Update windows installation and other notes

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 872094c, a8e88be · Browse files · 1 file+38 added−30 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+38 added−30 removed

  • other:+38 added−30 removed

1 file+38 added−30 removed

modified:docs/installation.rst+38 added-30 removed
1 unmodified line
23Installation4============56Flask depends on two external libraries, `Werkzeug6Flask depends on some external libraries, like `Werkzeug7<http://werkzeug.pocoo.org/>`_ and `Jinja2 <http://jinja.pocoo.org/2/>`_.8Werkzeug is a toolkit for WSGI, the standard Python interface between web9applications and a variety of servers for both development and deployment.10Jinja2 renders templates.
1 unmodified line
12So how do you get all that on your computer quickly? There are many ways you13could do that, but the most kick-ass method is virtualenv, so let's have a look14at that first.1516You will need Python 2.6 or higher to get started, so be sure to have an16You will need Python 2.6 or newer to get started, so be sure to have an17up-to-date Python 2.x installation. For using Flask with Python 3 have a18look at :ref:`python3-support`.1920.. _virtualenv:
45 unmodified lines
66 $ mkdir myproject67 $ cd myproject68 $ virtualenv venv69 New python executable in venv/bin/python70 Installing distribute............done.70 Installing setuptools, pip............done.7172Now, whenever you want to work on a project, you only have to activate the73corresponding environment. On OS X and Linux, do the following::74
37 unmodified lines
112113 $ git clone http://github.com/mitsuhiko/flask.git114 Initialized empty Git repository in ~/dev/flask/.git/115 $ cd flask116 $ virtualenv venv --distribute116 $ virtualenv venv117 New python executable in venv/bin/python118 Installing distribute............done.118 Installing setuptools, pip............done.119 $ . venv/bin/activate120 $ python setup.py develop121 ...122 Finished processing dependencies for Flask
5 unmodified lines
128To just get the development version without git, do this instead::129130 $ mkdir flask131 $ cd flask132 $ virtualenv venv --distribute132 $ virtualenv venv133 $ . venv/bin/activate134 New python executable in venv/bin/python135 Installing distribute............done.135 Installing setuptools, pip............done.136 $ pip install Flask==dev137 ...138 Finished processing dependencies for Flask==dev139140.. _windows-easy-install:141142`pip` and `distribute` on Windows143-----------------------------------142`pip` and `setuptools` on Windows143---------------------------------144145On Windows, installation of `easy_install` is a little bit trickier, but still146quite easy. The easiest way to do it is to download the147`distribute_setup.py`_ file and run it. The easiest way to run the file is to148open your downloads folder and double-click on the file.145Sometimes getting the standard "Python packaging tools" like *pip*, *setuptools*146and *virtualenv* can be a little trickier, but nothing very hard. The two crucial147packages you will need are setuptools and pip - these will let you install148anything else (like virtualenv). Fortunately there are two "bootstrap scripts"149you can run to install either.150150Next, add the `easy_install` command and other Python scripts to the151command search path, by adding your Python installation's Scripts folder152to the `PATH` environment variable. To do that, right-click on the153"Computer" icon on the Desktop or in the Start menu, and choose "Properties".154Then click on "Advanced System settings" (in Windows XP, click on the155"Advanced" tab instead). Then click on the "Environment variables" button.156Finally, double-click on the "Path" variable in the "System variables" section,157and add the path of your Python interpreter's Scripts folder. Be sure to158delimit it from existing values with a semicolon. Assuming you are using159Python 2.7 on the default path, add the following value::151If you don't currently have either, then `get-pip.py` will install both for you152(you won't need to run ez_setup.py).153154`get-pip.py`_155162 ;C:\Python27\Scripts156To install the latest setuptools, you can use its bootstrap file:157164And you are done! To check that it worked, open the Command Prompt and execute165``easy_install``. If you have User Account Control enabled on Windows Vista or166Windows 7, it should prompt you for administrator privileges.158`ez_setup.py`_159168Now that you have ``easy_install``, you can use it to install ``pip``::160Either should be double-clickable once you download them. If you already have pip,161you can upgrade them by running::162170 > easy_install pip163 > pip install --upgrade pip setuptools164165Most often, once you pull up a command prompt you want to be able to type ``pip``166and ``python`` which will run those things, but this might not automatically happen167on Windows, because it doesn't know where those executables are (give either a try!).168173.. _distribute_setup.py: http://python-distribute.org/distribute_setup.py169To fix this, you should be able to navigate to your Python install directory170(e.g ``C:\Python27``), then go to ``Tools``, then ``Scripts``; then find the171``win_add2path.py`` file and run that. Open a **new** Command Prompt and172check that you can now just type ``python`` to bring up the interpreter.173174Finally, to install `virtualenv`_, you can simply run::175176 > pip install virtualenv177 178Then you can be off on your way following the installation instructions above.179180.. _get-pip.py: https://raw.github.com/pypa/pip/master/contrib/get-pip.py181.. _ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py