Skip to content

Commit 02eb9c9

Browse files
committed
Merge pull request pallets#977 from Ivoz/patch-1
Update windows installation and other notes
2 parents 872094c + a8e88be commit 02eb9c9

File tree

1 file changed

+38
-30
lines changed

1 file changed

+38
-30
lines changed

docs/installation.rst

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Installation
44
============
55

6-
Flask depends on two external libraries, `Werkzeug
6+
Flask depends on some external libraries, like `Werkzeug
77
<http://werkzeug.pocoo.org/>`_ and `Jinja2 <http://jinja.pocoo.org/2/>`_.
88
Werkzeug is a toolkit for WSGI, the standard Python interface between web
99
applications and a variety of servers for both development and deployment.
@@ -13,7 +13,7 @@ So how do you get all that on your computer quickly? There are many ways you
1313
could do that, but the most kick-ass method is virtualenv, so let's have a look
1414
at that first.
1515

16-
You will need Python 2.6 or higher to get started, so be sure to have an
16+
You will need Python 2.6 or newer to get started, so be sure to have an
1717
up-to-date Python 2.x installation. For using Flask with Python 3 have a
1818
look at :ref:`python3-support`.
1919

@@ -67,7 +67,7 @@ folder within::
6767
$ cd myproject
6868
$ virtualenv venv
6969
New python executable in venv/bin/python
70-
Installing distribute............done.
70+
Installing setuptools, pip............done.
7171

7272
Now, whenever you want to work on a project, you only have to activate the
7373
corresponding environment. On OS X and Linux, do the following::
@@ -113,9 +113,9 @@ Get the git checkout in a new virtualenv and run in development mode::
113113
$ git clone http://github.com/mitsuhiko/flask.git
114114
Initialized empty Git repository in ~/dev/flask/.git/
115115
$ cd flask
116-
$ virtualenv venv --distribute
116+
$ virtualenv venv
117117
New python executable in venv/bin/python
118-
Installing distribute............done.
118+
Installing setuptools, pip............done.
119119
$ . venv/bin/activate
120120
$ python setup.py develop
121121
...
@@ -129,45 +129,53 @@ To just get the development version without git, do this instead::
129129

130130
$ mkdir flask
131131
$ cd flask
132-
$ virtualenv venv --distribute
132+
$ virtualenv venv
133133
$ . venv/bin/activate
134134
New python executable in venv/bin/python
135-
Installing distribute............done.
135+
Installing setuptools, pip............done.
136136
$ pip install Flask==dev
137137
...
138138
Finished processing dependencies for Flask==dev
139139

140140
.. _windows-easy-install:
141141

142-
`pip` and `distribute` on Windows
143-
-----------------------------------
142+
`pip` and `setuptools` on Windows
143+
---------------------------------
144+
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 crucial
147+
packages you will need are setuptools and pip - these will let you install
148+
anything else (like virtualenv). Fortunately there are two "bootstrap scripts"
149+
you can run to install either.
150+
151+
If you don't currently have either, then `get-pip.py` will install both for you
152+
(you won't need to run ez_setup.py).
153+
154+
`get-pip.py`_
144155

145-
On Windows, installation of `easy_install` is a little bit trickier, but still
146-
quite easy. The easiest way to do it is to download the
147-
`distribute_setup.py`_ file and run it. The easiest way to run the file is to
148-
open your downloads folder and double-click on the file.
156+
To install the latest setuptools, you can use its bootstrap file:
149157

150-
Next, add the `easy_install` command and other Python scripts to the
151-
command search path, by adding your Python installation's Scripts folder
152-
to the `PATH` environment variable. To do that, right-click on the
153-
"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 the
155-
"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 to
158-
delimit it from existing values with a semicolon. Assuming you are using
159-
Python 2.7 on the default path, add the following value::
158+
`ez_setup.py`_
160159

160+
Either should be double-clickable once you download them. If you already have pip,
161+
you can upgrade them by running::
161162

162-
;C:\Python27\Scripts
163+
> pip install --upgrade pip setuptools
163164

164-
And you are done! To check that it worked, open the Command Prompt and execute
165-
``easy_install``. If you have User Account Control enabled on Windows Vista or
166-
Windows 7, it should prompt you for administrator privileges.
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 happen
167+
on Windows, because it doesn't know where those executables are (give either a try!).
167168

168-
Now that you have ``easy_install``, you can use it to install ``pip``::
169+
To fix this, you should be able to navigate to your Python install directory
170+
(e.g ``C:\Python27``), then go to ``Tools``, then ``Scripts``; then find the
171+
``win_add2path.py`` file and run that. Open a **new** Command Prompt and
172+
check that you can now just type ``python`` to bring up the interpreter.
169173

170-
> easy_install pip
174+
Finally, to install `virtualenv`_, you can simply run::
171175

176+
> pip install virtualenv
177+
178+
Then you can be off on your way following the installation instructions above.
172179

173-
.. _distribute_setup.py: http://python-distribute.org/distribute_setup.py
180+
.. _get-pip.py: https://raw.github.com/pypa/pip/master/contrib/get-pip.py
181+
.. _ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py

0 commit comments

Comments
 (0)