Skip to content
Myr

Update installation documentation for using 'pip' command (#1920)

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

authored by Olexander Yermakov · committed by Jeff Widman · parent 67e3919 · Browse files · 1 file+18 added−29 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+18 added−29 removed

  • other:+18 added−29 removed

1 file+18 added−29 removed

modified:docs/installation.rst+18 added-29 removed
38 unmodified lines
39installations of Python, one for each project. It doesn't actually install40separate copies of Python, but it does provide a clever way to keep different41project environments isolated. Let's see how virtualenv works.4243If you are on Mac OS X or Linux, chances are that one of the following two44commands will work for you::43If you are on Mac OS X or Linux, chances are that the following44command will work for you::4546 $ sudo easy_install virtualenv4748or even better::4946 $ sudo pip install virtualenv4752One of these will probably install virtualenv on your system. Maybe it's even48It will probably install virtualenv on your system. Maybe it's even49in your package manager. If you use Ubuntu, try::5051 $ sudo apt-get install python-virtualenv5257If you are on Windows and don't have the :command:`easy_install` command, you must53If you are on Windows and don't have the ``easy_install`` command, you must54install it first. Check the :ref:`windows-easy-install` section for more55information about how to do that. Once you have it installed, run the same60commands as above, but without the :command:`sudo` prefix.56commands as above, but without the ``sudo`` prefix.5758Once you have virtualenv installed, just fire up a shell and create59your own environment. I usually create a project folder and a :file:`venv`60folder within::
33 unmodified lines
94System-Wide Installation95------------------------9697This is possible as well, though I do not recommend it. Just run102:command:`pip` with root privileges::98``pip`` with root privileges::99100 $ sudo pip install Flask101102(On Windows systems, run it in a command-prompt window with administrator107privileges, and leave out :command:`sudo`.)103privileges, and leave out ``sudo``.)104105106Living on the Edge107------------------108109If you want to work with the latest version of Flask, there are two ways: you114can either let :command:`pip` pull in the development version, or you can tell110can either let ``pip`` pull in the development version, or you can tell111it to operate on a git checkout. Either way, virtualenv is recommended.112113Get the git checkout in a new virtualenv and run in development mode::114
11 unmodified lines
126This will pull in the dependencies and activate the git head as the current127version inside the virtualenv. Then all you have to do is run ``git pull128origin`` to update to the latest version.129134130.. _windows-easy-install:131132`pip` and `setuptools` on Windows133---------------------------------134140Sometimes getting the standard "Python packaging tools" like *pip*, *setuptools*141and *virtualenv* can be a little trickier, but nothing very hard. The two crucial142packages you will need are setuptools and pip - these will let you install143anything else (like virtualenv). Fortunately there are two "bootstrap scripts"144you can run to install either.135Sometimes getting the standard "Python packaging tools" like ``pip``, ``setuptools``136and ``virtualenv`` can be a little trickier, but nothing very hard. The crucial137package you will need is pip - this will let you install138anything else (like virtualenv). Fortunately there is a "bootstrap script"139you can run to install.140146If you don't currently have either, then :file:`get-pip.py` will install both for you147(you won't need to run :file:`ez_setup.py`).141If you don't currently have ``pip``, then `get-pip.py` will install it for you.142143`get-pip.py`_144151To install the latest setuptools, you can use its bootstrap file:152153`ez_setup.py`_154155Either should be double-clickable once you download them. If you already have pip,145It should be double-clickable once you download it. If you already have ``pip``,146you can upgrade them by running::147148 > pip install --upgrade pip setuptools149160Most often, once you pull up a command prompt you want to be able to type :command:`pip`161and :command:`python` which will run those things, but this might not automatically happen150Most often, once you pull up a command prompt you want to be able to type ``pip``151and ``python`` which will run those things, but this might not automatically happen152on Windows, because it doesn't know where those executables are (give either a try!).153154To fix this, you should be able to navigate to your Python install directory155(e.g :file:`C:\Python27`), then go to :file:`Tools`, then :file:`Scripts`, then find the156:file:`win_add2path.py` file and run that. Open a **new** Command Prompt and167check that you can now just type :command:`python` to bring up the interpreter.157check that you can now just type ``python`` to bring up the interpreter.158159Finally, to install `virtualenv`_, you can simply run::160161 > pip install virtualenv162163Then you can be off on your way following the installation instructions above.164165.. _get-pip.py: https://bootstrap.pypa.io/get-pip.py176.. _ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py