Merge pull request #977 from Ivoz/patch-1
Update windows installation and other notes
This commit is contained in:
commit
02eb9c99fd
1 changed files with 38 additions and 30 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
Installation
|
Installation
|
||||||
============
|
============
|
||||||
|
|
||||||
Flask depends on two external libraries, `Werkzeug
|
Flask depends on some external libraries, like `Werkzeug
|
||||||
<http://werkzeug.pocoo.org/>`_ and `Jinja2 <http://jinja.pocoo.org/2/>`_.
|
<http://werkzeug.pocoo.org/>`_ and `Jinja2 <http://jinja.pocoo.org/2/>`_.
|
||||||
Werkzeug is a toolkit for WSGI, the standard Python interface between web
|
Werkzeug is a toolkit for WSGI, the standard Python interface between web
|
||||||
applications and a variety of servers for both development and deployment.
|
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
|
||||||
could do that, but the most kick-ass method is virtualenv, so let's have a look
|
could do that, but the most kick-ass method is virtualenv, so let's have a look
|
||||||
at that first.
|
at that first.
|
||||||
|
|
||||||
You will need Python 2.6 or higher to get started, so be sure to have an
|
You will need Python 2.6 or newer to get started, so be sure to have an
|
||||||
up-to-date Python 2.x installation. For using Flask with Python 3 have a
|
up-to-date Python 2.x installation. For using Flask with Python 3 have a
|
||||||
look at :ref:`python3-support`.
|
look at :ref:`python3-support`.
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ folder within::
|
||||||
$ cd myproject
|
$ cd myproject
|
||||||
$ virtualenv venv
|
$ virtualenv venv
|
||||||
New python executable in venv/bin/python
|
New python executable in venv/bin/python
|
||||||
Installing distribute............done.
|
Installing setuptools, pip............done.
|
||||||
|
|
||||||
Now, whenever you want to work on a project, you only have to activate the
|
Now, whenever you want to work on a project, you only have to activate the
|
||||||
corresponding environment. On OS X and Linux, do the following::
|
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::
|
||||||
$ git clone http://github.com/mitsuhiko/flask.git
|
$ git clone http://github.com/mitsuhiko/flask.git
|
||||||
Initialized empty Git repository in ~/dev/flask/.git/
|
Initialized empty Git repository in ~/dev/flask/.git/
|
||||||
$ cd flask
|
$ cd flask
|
||||||
$ virtualenv venv --distribute
|
$ virtualenv venv
|
||||||
New python executable in venv/bin/python
|
New python executable in venv/bin/python
|
||||||
Installing distribute............done.
|
Installing setuptools, pip............done.
|
||||||
$ . venv/bin/activate
|
$ . venv/bin/activate
|
||||||
$ python setup.py develop
|
$ python setup.py develop
|
||||||
...
|
...
|
||||||
|
|
@ -129,45 +129,53 @@ To just get the development version without git, do this instead::
|
||||||
|
|
||||||
$ mkdir flask
|
$ mkdir flask
|
||||||
$ cd flask
|
$ cd flask
|
||||||
$ virtualenv venv --distribute
|
$ virtualenv venv
|
||||||
$ . venv/bin/activate
|
$ . venv/bin/activate
|
||||||
New python executable in venv/bin/python
|
New python executable in venv/bin/python
|
||||||
Installing distribute............done.
|
Installing setuptools, pip............done.
|
||||||
$ pip install Flask==dev
|
$ pip install Flask==dev
|
||||||
...
|
...
|
||||||
Finished processing dependencies for Flask==dev
|
Finished processing dependencies for Flask==dev
|
||||||
|
|
||||||
.. _windows-easy-install:
|
.. _windows-easy-install:
|
||||||
|
|
||||||
`pip` and `distribute` on Windows
|
`pip` and `setuptools` on Windows
|
||||||
-----------------------------------
|
---------------------------------
|
||||||
|
|
||||||
On Windows, installation of `easy_install` is a little bit trickier, but still
|
Sometimes getting the standard "Python packaging tools" like *pip*, *setuptools*
|
||||||
quite easy. The easiest way to do it is to download the
|
and *virtualenv* can be a little trickier, but nothing very hard. The two crucial
|
||||||
`distribute_setup.py`_ file and run it. The easiest way to run the file is to
|
packages you will need are setuptools and pip - these will let you install
|
||||||
open your downloads folder and double-click on the file.
|
anything else (like virtualenv). Fortunately there are two "bootstrap scripts"
|
||||||
|
you can run to install either.
|
||||||
|
|
||||||
Next, add the `easy_install` command and other Python scripts to the
|
If you don't currently have either, then `get-pip.py` will install both for you
|
||||||
command search path, by adding your Python installation's Scripts folder
|
(you won't need to run ez_setup.py).
|
||||||
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 "Advanced System settings" (in Windows XP, click on the
|
|
||||||
"Advanced" tab instead). Then click on the "Environment variables" button.
|
|
||||||
Finally, double-click on the "Path" variable in the "System variables" section,
|
|
||||||
and add the path of your Python interpreter's Scripts folder. Be sure to
|
|
||||||
delimit it from existing values with a semicolon. Assuming you are using
|
|
||||||
Python 2.7 on the default path, add the following value::
|
|
||||||
|
|
||||||
|
`get-pip.py`_
|
||||||
|
|
||||||
;C:\Python27\Scripts
|
To install the latest setuptools, you can use its bootstrap file:
|
||||||
|
|
||||||
And you are done! To check that it worked, open the Command Prompt and execute
|
`ez_setup.py`_
|
||||||
``easy_install``. If you have User Account Control enabled on Windows Vista or
|
|
||||||
Windows 7, it should prompt you for administrator privileges.
|
|
||||||
|
|
||||||
Now that you have ``easy_install``, you can use it to install ``pip``::
|
Either should be double-clickable once you download them. If you already have pip,
|
||||||
|
you can upgrade them by running::
|
||||||
|
|
||||||
> easy_install pip
|
> pip install --upgrade pip setuptools
|
||||||
|
|
||||||
|
Most often, once you pull up a command prompt you want to be able to type ``pip``
|
||||||
|
and ``python`` which will run those things, but this might not automatically happen
|
||||||
|
on Windows, because it doesn't know where those executables are (give either a try!).
|
||||||
|
|
||||||
.. _distribute_setup.py: http://python-distribute.org/distribute_setup.py
|
To fix this, you should be able to navigate to your Python install directory
|
||||||
|
(e.g ``C:\Python27``), then go to ``Tools``, then ``Scripts``; then find the
|
||||||
|
``win_add2path.py`` file and run that. Open a **new** Command Prompt and
|
||||||
|
check that you can now just type ``python`` to bring up the interpreter.
|
||||||
|
|
||||||
|
Finally, to install `virtualenv`_, you can simply run::
|
||||||
|
|
||||||
|
> pip install virtualenv
|
||||||
|
|
||||||
|
Then you can be off on your way following the installation instructions above.
|
||||||
|
|
||||||
|
.. _get-pip.py: https://raw.github.com/pypa/pip/master/contrib/get-pip.py
|
||||||
|
.. _ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue