1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
pip/docs/index.txt

173 lines
5.5 KiB
Plaintext
Raw Normal View History

pip
===
2008-10-16 00:02:57 +02:00
pip is a tool for installing and managing Python packages, such as those
found in the `Python Package Index <http://pypi.python.org/pypi>`_.
pip is a replacement for `easy_install
<http://peak.telecommunity.com/DevCenter/EasyInstall>`_. It mostly
uses the same techniques for finding packages, so packages that are
easy_installable should be pip-installable as well. This means that
you can use ``pip install SomePackage`` instead of ``easy_install
SomePackage``.
In order to use pip, you must first install `setuptools
<http://pypi.python.org/pypi/setuptools>`_ or `distribute
2011-05-01 19:53:35 +02:00
<http://pypi.python.org/pypi/distribute>`_. If you use `virtualenv
<http://www.virtualenv.org>`_, a copy of pip will be automatically be
installed in each virtual environment you create.
.. comment: split here
2008-10-16 00:02:57 +02:00
.. toctree::
2009-10-25 02:25:13 +01:00
:maxdepth: 1
2008-10-16 00:02:57 +02:00
news
2011-03-15 06:43:03 +01:00
installing
usage
requirements
configuration
how-to-contribute
running-tests
2008-10-16 00:02:57 +02:00
.. comment: split here
2010-05-28 06:28:39 +02:00
Pip Compared To easy_install
----------------------------
pip is meant to improve on easy_install. Some of the improvements:
2008-10-16 00:02:57 +02:00
* All packages are downloaded before installation. Partially-completed
installation doesn't occur as a result.
* Care is taken to present useful output on the console.
* The reasons for actions are kept track of. For instance, if a package is
being installed, pip keeps track of why that package was required.
2008-10-16 00:02:57 +02:00
* Error messages should be useful.
* The code is relatively concise and cohesive, making it easier to use
programmatically.
* Packages don't have to be installed as egg archives, they can be installed
flat (while keeping the egg metadata).
* Native support for other version control systems (Git, Mercurial and Bazaar)
2009-10-02 20:06:26 +02:00
* Uninstallation of packages.
2008-10-16 00:02:57 +02:00
2009-10-02 20:06:26 +02:00
* Simple to define fixed sets of requirements and reliably reproduce a
set of packages.
2008-10-16 00:02:57 +02:00
pip doesn't do everything that easy_install does. Specifically:
* It cannot install from eggs. It only installs from source. (In the
future it would be good if it could install binaries from Windows ``.exe``
or ``.msi`` -- binary install on other platforms is not a priority.)
* It doesn't understand Setuptools extras (like ``package[test]``). This should
be added eventually.
* It is incompatible with some packages that extensively customize distutils
or setuptools in their ``setup.py`` files.
pip is complementary with `virtualenv
2010-05-28 06:30:41 +02:00
<http://pypi.python.org/pypi/virtualenv>`__, and it is encouraged that you use
2008-10-16 00:02:57 +02:00
virtualenv to isolate your installation.
Community
---------
The homepage for pip is at `pip-installer.org <http://www.pip-installer.org/>`_.
Bugs can be filed in the `pip issue tracker
<https://github.com/pypa/pip/issues/>`_. Discussion happens on the
2009-01-21 19:12:04 +01:00
`virtualenv email group
2008-10-16 00:02:57 +02:00
<http://groups.google.com/group/python-virtualenv?hl=en>`_.
Bundles
-------
Another way to distribute a set of libraries is a bundle format (specific to
pip). This format is not stable at this time (there simply hasn't been
2008-10-16 00:02:57 +02:00
any feedback, nor a great deal of thought). A bundle file contains all the
2010-04-22 10:07:57 +02:00
source for your package, and you can have pip install them all together.
2008-10-16 00:02:57 +02:00
Once you have the bundle file further network access won't be necessary. To
build a bundle file, do::
2009-02-04 19:44:51 +01:00
$ pip bundle MyApp.pybundle MyApp
2008-10-16 00:02:57 +02:00
(Using a `requirements file`_ would be wise.) Then someone else can get the
file ``MyApp.pybundle`` and run::
$ pip install MyApp.pybundle
2008-10-16 00:02:57 +02:00
This is *not* a binary format. This only packages source. If you have binary
packages, then the person who installs the files will have to have a compiler,
any necessary headers installed, etc. Binary packages are hard, this is
relatively easy.
2009-10-25 02:25:13 +01:00
Using pip with virtualenv
-------------------------
2008-10-16 00:02:57 +02:00
pip is most nutritious when used with `virtualenv
2010-05-28 06:30:41 +02:00
<http://pypi.python.org/pypi/virtualenv>`__. One of the reasons pip
2008-10-16 00:02:57 +02:00
doesn't install "multi-version" eggs is that virtualenv removes much of the need
2010-05-28 06:28:39 +02:00
for it. Because pip is installed by virtualenv, just use
``path/to/my/environment/bin/pip`` to install things into that
specific environment.
To tell pip to only run if there is a virtualenv currently activated,
and to bail if not, use::
export PIP_REQUIRE_VIRTUALENV=true
Using pip with virtualenvwrapper
---------------------------------
If you are using `virtualenvwrapper
<http://www.doughellmann.com/projects/virtualenvwrapper/>`_, you might
want pip to automatically create its virtualenvs in your
``$WORKON_HOME``.
You can tell pip to do so by defining ``PIP_VIRTUALENV_BASE`` in your
environment and setting it to the same value as that of
``$WORKON_HOME``.
2009-07-28 10:11:39 +02:00
Do so by adding the line::
export PIP_VIRTUALENV_BASE=$WORKON_HOME
2009-07-28 10:11:39 +02:00
in your .bashrc under the line starting with ``export WORKON_HOME``.
Using pip with buildout
-----------------------
If you are using `zc.buildout
<http://pypi.python.org/pypi/zc.buildout>`_ you should look at
`gp.recipe.pip <http://pypi.python.org/pypi/gp.recipe.pip>`_ as an
option to use pip and virtualenv in your buildouts.
Command line completion
-----------------------
pip comes with support for command line completion in bash and zsh and
allows you tab complete commands and options. To enable it you simply
need copy the required shell script to the your shell startup file
(e.g. ``.profile`` or ``.zprofile``) by running the special ``completion``
command, e.g. for bash::
$ pip completion --bash >> ~/.profile
And for zsh::
$ pip completion --zsh >> ~/.zprofile
Alternatively, you can use the result of the ``completion`` command
directly with the eval function of you shell, e.g. by adding::
eval "`pip completion --bash`"
to your startup file.