Update windows installation and other notes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Making allowance for new convenience of `get-pip.py` that automatically installs setuptools and pip together. Stop recommending distribute, which has now been merged into setuptools.
authored by Matt Iversen · committed by Matt Iversen · parent 98754b0 · 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
Provenance
- Commit
a8e88be- Tree
e4c3538- Author
Matt Iversen <teh.ivo@gmail.com>- Committer
Matt Iversen <teh.ivo@gmail.com>- Parent
98754b0
1 file changed+38 added−30 removed
modified:docs/installation.rst+38 added-30 removed
1 unmodified line2 3 Installation4 ============5 6-Flask depends on two external libraries, `Werkzeug6+Flask depends on some external libraries, like `Werkzeug7 <http://werkzeug.pocoo.org/>`_ and `Jinja2 <http://jinja.pocoo.org/2/>`_.8 Werkzeug is a toolkit for WSGI, the standard Python interface between web9 applications and a variety of servers for both development and deployment.10 Jinja2 renders templates.1 unmodified line12 So how do you get all that on your computer quickly? There are many ways you13 could do that, but the most kick-ass method is virtualenv, so let's have a look14 at that first.15 16-You will need Python 2.6 or higher to get started, so be sure to have an16+You will need Python 2.6 or newer to get started, so be sure to have an17 up-to-date Python 2.x installation. For using Flask with Python 3 have a18 look at :ref:`python3-support`.19 20 .. _virtualenv:45 unmodified lines66 $ mkdir myproject67 $ cd myproject68 $ virtualenv venv69 New python executable in venv/bin/python70- Installing distribute............done.70+ Installing setuptools, pip............done.71 72 Now, whenever you want to work on a project, you only have to activate the73 corresponding environment. On OS X and Linux, do the following::74 37 unmodified lines112 113 $ 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 Flask5 unmodified lines128 To just get the development version without git, do this instead::129 130 $ 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==dev139 140 .. _windows-easy-install:141 142-`pip` and `distribute` on Windows143------------------------------------142+`pip` and `setuptools` on Windows143+---------------------------------144 145-On Windows, installation of `easy_install` is a little bit trickier, but still146-quite 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 to148-open your downloads folder and double-click on the file.145+Sometimes getting the standard "Python packaging tools" like *pip*, *setuptools*146+and *virtualenv* can be a little trickier, but nothing very hard. The two crucial147+packages you will need are setuptools and pip - these will let you install148+anything else (like virtualenv). Fortunately there are two "bootstrap scripts"149+you can run to install either.150 150-Next, add the `easy_install` command and other Python scripts to the151-command search path, by adding your Python installation's Scripts folder152-to the `PATH` environment variable. To do that, right-click on the153-"Computer" icon on the Desktop or in the Start menu, and choose "Properties".154-Then click on "Advanced System settings" (in Windows XP, click on the155-"Advanced" tab instead). Then click on the "Environment variables" button.156-Finally, double-click on the "Path" variable in the "System variables" section,157-and add the path of your Python interpreter's Scripts folder. Be sure to158-delimit it from existing values with a semicolon. Assuming you are using159-Python 2.7 on the default path, add the following value::151+If you don't currently have either, then `get-pip.py` will install both for you152+(you won't need to run ez_setup.py).153 154+`get-pip.py`_155 162- ;C:\Python27\Scripts156+To install the latest setuptools, you can use its bootstrap file:157 164-And 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 or166-Windows 7, it should prompt you for administrator privileges.158+`ez_setup.py`_159 168-Now that you have ``easy_install``, you can use it to install ``pip``::160+Either should be double-clickable once you download them. If you already have pip,161+you can upgrade them by running::162 170- > easy_install pip163+ > pip install --upgrade pip setuptools164 165+Most often, once you pull up a command prompt you want to be able to type ``pip``166+and ``python`` which will run those things, but this might not automatically happen167+on Windows, because it doesn't know where those executables are (give either a try!).168 173-.. _distribute_setup.py: http://python-distribute.org/distribute_setup.py169+To 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 and172+check that you can now just type ``python`` to bring up the interpreter.173+174+Finally, to install `virtualenv`_, you can simply run::175+176+ > pip install virtualenv177+ 178+Then you can be off on your way following the installation instructions above.179+180+.. _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