1.. _tutorials.installing.packages: 2 3Installing packages 4=================== 5To use webapp2 outside of App Engine, you need a package manager to install 6dependencies in your system -- mostly WebOb, and maybe libraries required 7by the various webapp2_extras modules, if you will use them. 8 9For App Engine, some webapp2_extras modules may require that you install 10external packages to access specific command line tools (i18n, for example, 11uses pybabel to extract and compile translation catalogs). 12 13In this tutorial we'll show how to install a package manager and installer. 14 15 16Install a distutils library 17--------------------------- 18If you don't have a distutils library (`distribute <http://pypi.python.org/pypi/distribute>`_ 19or `setuptools <http://pypi.python.org/pypi/setuptools>`_) installed on 20you system yet, you need to install one. Distribute is recommended, but 21setuptools will serve as well. 22 23Distribute is "the standard method for working with Python module 24distributions". It will manage our package dependencies and upgrades. 25If you already have one of them, jump to next step. If not, the installation 26is straighforward: 27 28**1.** Download the installer and save it anywhere. It is a single file: 29 30 http://python-distribute.org/distribute_setup.py 31 32**2.** Execute it from the command line (this will require sudo if you are 33using Linux or a Mac): 34 35.. code-block:: text 36 37 $ python distribute_setup.py 38 39If you don't see any error messages, yay, it installed successfully. Let's 40move forward. For Windows, check the distribute or setuptools documentation. 41 42 43Install a package installer 44--------------------------- 45We need a package installer (``pip`` or ``easy_install``) to install and 46update Python packages. Any will work, but if you don't have one yet, ``pip`` 47is recommended. Here's how to install it: 48 49**1.** Download ``pip`` from PyPi: 50 51 http://pypi.python.org/pypi/pip 52 53**2.** Unpack it and access the unpacked directory using the command line. 54Then run ``setup.py install`` on that directory (this will require sudo if you 55are using Linux or a Mac): 56 57.. code-block:: text 58 59 $ python setup.py install 60 61That's it. If you don't see any error messages, the ``pip`` command should 62now be available in your system. 63