2015-07-29 22:25:13 +02:00
|
|
|
|
|
|
|
.. _`pip download`:
|
|
|
|
|
2020-02-11 12:37:58 +01:00
|
|
|
============
|
2015-07-29 22:25:13 +02:00
|
|
|
pip download
|
2020-02-11 12:37:58 +01:00
|
|
|
============
|
2015-07-29 22:25:13 +02:00
|
|
|
|
2017-11-12 17:04:37 +01:00
|
|
|
.. contents::
|
|
|
|
|
2020-02-11 14:05:28 +01:00
|
|
|
|
2015-07-29 22:25:13 +02:00
|
|
|
Usage
|
2020-02-11 14:00:03 +01:00
|
|
|
=====
|
2015-07-29 22:25:13 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Unix/macOS
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. pip-command-usage:: download "python -m pip"
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Windows
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. pip-command-usage:: download "py -m pip"
|
2015-07-29 22:25:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
Description
|
2020-02-11 14:00:03 +01:00
|
|
|
===========
|
2015-07-29 22:25:13 +02:00
|
|
|
|
|
|
|
.. pip-command-description:: download
|
|
|
|
|
|
|
|
Overview
|
2020-02-11 14:00:03 +01:00
|
|
|
--------
|
2015-07-29 22:25:13 +02:00
|
|
|
|
|
|
|
``pip download`` does the same resolution and downloading as ``pip install``,
|
|
|
|
but instead of installing the dependencies, it collects the downloaded
|
2016-01-19 17:37:14 +01:00
|
|
|
distributions into the directory provided (defaulting to the current
|
2015-12-21 02:20:59 +01:00
|
|
|
directory). This directory can later be passed as the value to ``pip install
|
|
|
|
--find-links`` to facilitate offline or locked down package installation.
|
|
|
|
|
|
|
|
``pip download`` with the ``--platform``, ``--python-version``,
|
|
|
|
``--implementation``, and ``--abi`` options provides the ability to fetch
|
|
|
|
dependencies for an interpreter and system other than the ones that pip is
|
2017-06-04 18:01:03 +02:00
|
|
|
running on. ``--only-binary=:all:`` or ``--no-deps`` is required when using any
|
|
|
|
of these options. It is important to note that these options all default to the
|
2015-12-21 02:20:59 +01:00
|
|
|
current system/interpreter, and not to the most restrictive constraints (e.g.
|
|
|
|
platform any, abi none, etc). To avoid fetching dependencies that happen to
|
|
|
|
match the constraint of the current interpreter (but not your target one), it
|
|
|
|
is recommended to specify all of these options if you are specifying one of
|
|
|
|
them. Generic dependencies (e.g. universal wheels, or dependencies with no
|
|
|
|
platform, abi, or implementation constraints) will still match an over-
|
|
|
|
constrained download requirement.
|
|
|
|
|
2015-07-29 22:25:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
Options
|
2020-02-11 14:00:03 +01:00
|
|
|
=======
|
2015-07-29 22:25:13 +02:00
|
|
|
|
|
|
|
.. pip-command-options:: download
|
|
|
|
|
2019-11-12 23:54:43 +01:00
|
|
|
.. pip-index-options:: download
|
2015-07-29 22:25:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
Examples
|
2020-02-11 14:00:03 +01:00
|
|
|
========
|
2015-07-29 22:25:13 +02:00
|
|
|
|
2016-07-21 20:06:34 +02:00
|
|
|
#. Download a package and all of its dependencies
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Unix/macOS
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: shell
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
python -m pip download SomePackage
|
|
|
|
python -m pip download -d . SomePackage # equivalent to above
|
|
|
|
python -m pip download --no-index --find-links=/tmp/wheelhouse -d /tmp/otherwheelhouse SomePackage
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Windows
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: shell
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
py -m pip download SomePackage
|
|
|
|
py -m pip download -d . SomePackage # equivalent to above
|
|
|
|
py -m pip download --no-index --find-links=/tmp/wheelhouse -d /tmp/otherwheelhouse SomePackage
|
2016-06-05 22:49:03 +02:00
|
|
|
|
|
|
|
|
2016-07-21 20:06:34 +02:00
|
|
|
#. Download a package and all of its dependencies with OSX specific interpreter constraints.
|
2020-08-25 13:48:04 +02:00
|
|
|
This forces OSX 10.10 or lower compatibility. Since OSX deps are forward compatible,
|
|
|
|
this will also match ``macosx-10_9_x86_64``, ``macosx-10_8_x86_64``, ``macosx-10_8_intel``,
|
|
|
|
etc.
|
|
|
|
It will also match deps with platform ``any``. Also force the interpreter version to ``27``
|
|
|
|
(or more generic, i.e. ``2``) and implementation to ``cp`` (or more generic, i.e. ``py``).
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Unix/macOS
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: shell
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
python -m pip download \
|
|
|
|
--only-binary=:all: \
|
|
|
|
--platform macosx-10_10_x86_64 \
|
|
|
|
--python-version 27 \
|
|
|
|
--implementation cp \
|
|
|
|
SomePackage
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Windows
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: shell
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
py -m pip download ^
|
|
|
|
--only-binary=:all: ^
|
|
|
|
--platform macosx-10_10_x86_64 ^
|
|
|
|
--python-version 27 ^
|
|
|
|
--implementation cp ^
|
|
|
|
SomePackage
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2016-07-21 20:06:34 +02:00
|
|
|
#. Download a package and its dependencies with linux specific constraints.
|
2020-08-25 13:48:04 +02:00
|
|
|
Force the interpreter to be any minor version of py3k, and only accept
|
|
|
|
``cp34m`` or ``none`` as the abi.
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Unix/macOS
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: shell
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
python -m pip download \
|
|
|
|
--only-binary=:all: \
|
|
|
|
--platform linux_x86_64 \
|
|
|
|
--python-version 3 \
|
|
|
|
--implementation cp \
|
|
|
|
--abi cp34m \
|
|
|
|
SomePackage
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Windows
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: shell
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
py -m pip download ^
|
|
|
|
--only-binary=:all: ^
|
|
|
|
--platform linux_x86_64 ^
|
|
|
|
--python-version 3 ^
|
|
|
|
--implementation cp ^
|
|
|
|
--abi cp34m ^
|
|
|
|
SomePackage
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2016-07-21 20:06:34 +02:00
|
|
|
#. Force platform, implementation, and abi agnostic deps.
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Unix/macOS
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: shell
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
python -m pip download \
|
|
|
|
--only-binary=:all: \
|
|
|
|
--platform any \
|
|
|
|
--python-version 3 \
|
|
|
|
--implementation py \
|
|
|
|
--abi none \
|
|
|
|
SomePackage
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Windows
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: shell
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
py -m pip download ^
|
|
|
|
--only-binary=:all: ^
|
|
|
|
--platform any ^
|
|
|
|
--python-version 3 ^
|
|
|
|
--implementation py ^
|
|
|
|
--abi none ^
|
|
|
|
SomePackage
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2016-07-21 20:06:34 +02:00
|
|
|
#. Even when overconstrained, this will still correctly fetch the pip universal wheel.
|
2016-06-05 22:49:03 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Unix/macOS
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: console
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
$ python -m pip download \
|
|
|
|
--only-binary=:all: \
|
|
|
|
--platform linux_x86_64 \
|
|
|
|
--python-version 33 \
|
|
|
|
--implementation cp \
|
|
|
|
--abi cp34m \
|
|
|
|
pip>=8
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: console
|
2020-08-25 13:48:04 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
$ ls pip-8.1.1-py2.py3-none-any.whl
|
|
|
|
pip-8.1.1-py2.py3-none-any.whl
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. tab:: Windows
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: console
|
2020-08-25 13:48:04 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
C:\> py -m pip download ^
|
|
|
|
--only-binary=:all: ^
|
|
|
|
--platform linux_x86_64 ^
|
|
|
|
--python-version 33 ^
|
|
|
|
--implementation cp ^
|
|
|
|
--abi cp34m ^
|
|
|
|
pip>=8
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
.. code-block:: console
|
2020-08-06 05:18:37 +02:00
|
|
|
|
2020-10-18 19:12:24 +02:00
|
|
|
C:\> dir pip-8.1.1-py2.py3-none-any.whl
|
|
|
|
pip-8.1.1-py2.py3-none-any.whl
|