<commit_before>.. _`Installation`:

Installation
============

Do I need to install pip?
-------------------------

pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4
downloaded from `python.org <https://www.python.org>`_.

Additionally, pip will already be installed if you're working in a :ref:`Virtual Envionment
<pypug:Creating and using Virtual Environments>` created by a tool like
:ref:`pypug:virtualenv` or :ref:`pyvenv <pypug:venv>`.


.. _`get-pip`:

Installing with get-pip.py
--------------------------

To install pip, securely download `get-pip.py
<https://bootstrap.pypa.io/get-pip.py>`_. [2]_

Then run the following:

::

 python get-pip.py


.. warning::

   Be cautious if you're using a Python install that's managed by your operating
   system or another package manager. get-pip.py does not coordinate with
   those tools, and may leave your system in an inconsistent state.

get-pip.py will also intall :ref:`pypug:setuptools` [3]_ and :ref:`pypug:wheel`,
if they're not already. :ref:`pypug:setuptools` is required to install
:term:`source distributions <pypug:Source Distribution (or "sdist")>`.  Both are
required to be able to build a :ref:`Wheel cache` (which improves installation
speed), although neither are required to install pre-built :term:`wheels
<pypug:Wheel>`.


get-pip.py options
~~~~~~~~~~~~~~~~~~~

.. option:: --no-setuptools

    If set, don't attempt to install :ref:`pypug:setuptools`

.. option:: --no-wheel

    If set, don't attempt to install :ref:`pypug:wheel`


Additionally, ``get-pip.py`` supports using the :ref:`pip install options <pip
install Options>` and the :ref:`general options <General Options>`. Below are
some examples:

Install from local copies of pip and setuptools::

  python get-pip.py --no-index --find-links=/local/copies

Install to the user site [4]_::

  python get-pip.py --user

Install behind a proxy::

  python get-pip.py --proxy="[user:passwd@]proxy.server:port"


Using OS Package Managers
-------------------------

On Linux, pip will generally be available for the system install of python using
the system package manager, although often the latest version will be
unavailable.

On Debian and Ubuntu::

   sudo apt-get install python-pip

On Fedora::

   sudo yum install python-pip


Upgrading
---------

On Linux or OS X:

::

 pip install -U pip


On Windows [5]_:

::<commit_msg>mention that pre-installed pip needs to be upgraded<commit_after>.. _`Installation`:

Installation
============

Do I need to install pip?
-------------------------

pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4
downloaded from `python.org <https://www.python.org>`_, but you'll need to
:ref:`upgrade pip <Upgrading pip>`.

Additionally, pip will already be installed if you're working in a :ref:`Virtual Envionment
<pypug:Creating and using Virtual Environments>` created by a tool like
:ref:`pypug:virtualenv` or :ref:`pyvenv <pypug:venv>`.


.. _`get-pip`:

Installing with get-pip.py
--------------------------

To install pip, securely download `get-pip.py
<https://bootstrap.pypa.io/get-pip.py>`_. [2]_

Then run the following:

::

 python get-pip.py


.. warning::

   Be cautious if you're using a Python install that's managed by your operating
   system or another package manager. get-pip.py does not coordinate with
   those tools, and may leave your system in an inconsistent state.

get-pip.py will also intall :ref:`pypug:setuptools` [3]_ and :ref:`pypug:wheel`,
if they're not already. :ref:`pypug:setuptools` is required to install
:term:`source distributions <pypug:Source Distribution (or "sdist")>`.  Both are
required to be able to build a :ref:`Wheel cache` (which improves installation
speed), although neither are required to install pre-built :term:`wheels
<pypug:Wheel>`.


get-pip.py options
~~~~~~~~~~~~~~~~~~~

.. option:: --no-setuptools

    If set, don't attempt to install :ref:`pypug:setuptools`

.. option:: --no-wheel

    If set, don't attempt to install :ref:`pypug:wheel`


Additionally, ``get-pip.py`` supports using the :ref:`pip install options <pip
install Options>` and the :ref:`general options <General Options>`. Below are
some examples:

Install from local copies of pip and setuptools::

  python get-pip.py --no-index --find-links=/local/copies

Install to the user site [4]_::

  python get-pip.py --user

Install behind a proxy::

  python get-pip.py --proxy="[user:passwd@]proxy.server:port"


Using OS Package Managers
-------------------------

On Linux, pip will generally be available for the system install of python using
the system package manager, although often the latest version will be
unavailable.

On Debian and Ubuntu::

   sudo apt-get install python-pip

On Fedora::

   sudo yum install python-pip


.. _`Upgrading pip`:

Upgrading pip
-------------

On Linux or OS X:

::

 pip install -U pip


On Windows [5]_:

::
{'fraction_non_alphanumeric': 0.15184205169957257, 'fraction_numerical': 0.004477915733767555, 'mean_word_length': 3.4917733089579523, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 24, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6157792', 'n_tokens_mistral': 1598, 'n_tokens_neox': 1453, 'n_words': 578}