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
Provenance
- Commit
b7a0cc6- Tree
e040238- Author
Olexander Yermakov <mannavard1611@gmail.com>- Committer
Jeff Widman <jeff@jeffwidman.com>- Parent
67e3919
1 file changed+18 added−29 removed
modified:docs/installation.rst+18 added-29 removed
38 unmodified lines39 installations of Python, one for each project. It doesn't actually install40 separate copies of Python, but it does provide a clever way to keep different41 project environments isolated. Let's see how virtualenv works.42 43-If you are on Mac OS X or Linux, chances are that one of the following two44-commands will work for you::43+If you are on Mac OS X or Linux, chances are that the following44+command will work for you::45 46- $ sudo easy_install virtualenv47-48-or even better::49-46 $ sudo pip install virtualenv47 52-One of these will probably install virtualenv on your system. Maybe it's even48+It will probably install virtualenv on your system. Maybe it's even49 in your package manager. If you use Ubuntu, try::50 51 $ sudo apt-get install python-virtualenv52 57-If you are on Windows and don't have the :command:`easy_install` command, you must53+If you are on Windows and don't have the ``easy_install`` command, you must54 install it first. Check the :ref:`windows-easy-install` section for more55 information about how to do that. Once you have it installed, run the same60-commands as above, but without the :command:`sudo` prefix.56+commands as above, but without the ``sudo`` prefix.57 58 Once you have virtualenv installed, just fire up a shell and create59 your own environment. I usually create a project folder and a :file:`venv`60 folder within::33 unmodified lines94 System-Wide Installation95 ------------------------96 97 This is possible as well, though I do not recommend it. Just run102-:command:`pip` with root privileges::98+``pip`` with root privileges::99 100 $ sudo pip install Flask101 102 (On Windows systems, run it in a command-prompt window with administrator107-privileges, and leave out :command:`sudo`.)103+privileges, and leave out ``sudo``.)104 105 106 Living on the Edge107 ------------------108 109 If you want to work with the latest version of Flask, there are two ways: you114-can either let :command:`pip` pull in the development version, or you can tell110+can either let ``pip`` pull in the development version, or you can tell111 it to operate on a git checkout. Either way, virtualenv is recommended.112 113 Get the git checkout in a new virtualenv and run in development mode::114 11 unmodified lines126 This will pull in the dependencies and activate the git head as the current127 version inside the virtualenv. Then all you have to do is run ``git pull128 origin`` to update to the latest version.129 134-130 .. _windows-easy-install:131 132 `pip` and `setuptools` on Windows133 ---------------------------------134 140-Sometimes getting the standard "Python packaging tools" like *pip*, *setuptools*141-and *virtualenv* can be a little trickier, but nothing very hard. The two crucial142-packages you will need are setuptools and pip - these will let you install143-anything else (like virtualenv). Fortunately there are two "bootstrap scripts"144-you can run to install either.135+Sometimes getting the standard "Python packaging tools" like ``pip``, ``setuptools``136+and ``virtualenv`` can be a little trickier, but nothing very hard. The crucial137+package you will need is pip - this will let you install138+anything else (like virtualenv). Fortunately there is a "bootstrap script"139+you can run to install.140 146-If 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`).141+If you don't currently have ``pip``, then `get-pip.py` will install it for you.142 143 `get-pip.py`_144 151-To install the latest setuptools, you can use its bootstrap file:152-153-`ez_setup.py`_154-155-Either should be double-clickable once you download them. If you already have pip,145+It should be double-clickable once you download it. If you already have ``pip``,146 you can upgrade them by running::147 148 > pip install --upgrade pip setuptools149 160-Most often, once you pull up a command prompt you want to be able to type :command:`pip`161-and :command:`python` which will run those things, but this might not automatically happen150+Most often, once you pull up a command prompt you want to be able to type ``pip``151+and ``python`` which will run those things, but this might not automatically happen152 on Windows, because it doesn't know where those executables are (give either a try!).153 154 To 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 and167-check that you can now just type :command:`python` to bring up the interpreter.157+check that you can now just type ``python`` to bring up the interpreter.158 159 Finally, to install `virtualenv`_, you can simply run::160 161 > pip install virtualenv162 163 Then you can be off on your way following the installation instructions above.164 165 .. _get-pip.py: https://bootstrap.pypa.io/get-pip.py176-.. _ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py