Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions source/tutorials/installing-packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ check this by running:
py -m pip --version

If you installed Python from source, with an installer from `python.org`_, or
via `Homebrew`_ you should already have pip. If you're on Linux and installed
via `Homebrew`_, you should already have pip. If you're on Linux and installed
using your OS package manager, you may have to install pip separately, see
:doc:`/guides/installing-using-linux-tools`.

Expand Down Expand Up @@ -144,9 +144,9 @@ If that still doesn't allow you to run ``python -m pip``:

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
coordinate with those tools and may leave your system in an
inconsistent state. You can use ``python get-pip.py --prefix=/usr/local/``
to install in ``/usr/local`` which is designed for locally-installed
to install in ``/usr/local`` which is designed for locally installed
software.


Expand Down Expand Up @@ -188,7 +188,7 @@ but here's the basic :doc:`venv <python:library/venv>` [3]_ command to use on a
py -m venv tutorial_env
tutorial_env\Scripts\activate

This will create a new virtual environment in the ``tutorial_env`` subdirectory,
This will create a new virtual environment in the ``tutorial_env`` subdirectory
and configure the current shell to use it as the default ``python`` environment.


Expand All @@ -200,7 +200,7 @@ Creating Virtual Environments
Python "Virtual Environments" allow Python :term:`packages <Distribution
Package>` to be installed in an isolated location for a particular application,
rather than being installed globally. If you are looking to safely install
global command line tools,
global command-line tools,
see :doc:`/guides/installing-stand-alone-command-line-tools`.

Imagine you have an application that needs version 1 of LibFoo, but another
Expand All @@ -217,7 +217,7 @@ Also, what if you can’t install :term:`packages <Distribution Package>` into t
global site-packages directory? For instance, on a shared host.

In all these cases, virtual environments can help you. They have their own
installation directories and they don’t share libraries with other virtual
installation directories and don’t share libraries with other virtual
environments.

Currently, there are two common tools for creating Python virtual environments:
Expand Down Expand Up @@ -281,10 +281,9 @@ script directly from the command shell like so:
<DIR>\Scripts\activate



Managing multiple virtual environments directly can become tedious, so the
:ref:`dependency management tutorial <managing-dependencies>` introduces a
higher level tool, :ref:`Pipenv`, that automatically manages a separate
:ref:`dependency management tutorial <managing-dependencies>` introduces
:ref:`Pipenv`, a higher-level tool that automatically manages a separate
virtual environment for each project and application that you work on.


Expand Down Expand Up @@ -375,7 +374,7 @@ Source Distributions vs Wheels
:ref:`pip` can install from either :term:`Source Distributions (sdist) <Source
Distribution (or "sdist")>` or :term:`Wheels <Wheel>`, but if both are present
on PyPI, pip will prefer a compatible :term:`wheel <Wheel>`. You can override
pip`s default behavior by e.g. using its :ref:`--no-binary
pip's default behavior by e.g. using its :ref:`--no-binary
<pip:install_--no-binary>` option.

:term:`Wheels <Wheel>` are a pre-built :term:`distribution <Distribution
Expand All @@ -391,7 +390,7 @@ in the future.
Upgrading packages
==================

Upgrade an already installed ``SomeProject`` to the latest from PyPI.
Upgrade an already installed ``SomeProject`` to the latest from PyPI:

.. tab:: Unix/macOS

Expand Down Expand Up @@ -425,12 +424,12 @@ current user, use the ``--user`` flag:

py -m pip install --user SomeProject

For more information see the `User Installs
For more information, see the `User Installs
<https://pip.pypa.io/en/latest/user_guide/#user-installs>`_ section
from the pip docs.

Note that the ``--user`` flag has no effect when inside a virtual environment
- all installation commands will affect the virtual environment.
– all installation commands will affect the virtual environment.

If ``SomeProject`` defines any command-line scripts or console entry points,
``--user`` will cause them to be installed inside the `user base`_'s binary
Expand All @@ -443,13 +442,13 @@ directory to your :envvar:`PATH`:
- On Linux and macOS you can find the user base binary directory by running
``python -m site --user-base`` and adding ``bin`` to the end. For example,
this will typically print ``~/.local`` (with ``~`` expanded to the absolute
path to your home directory) so you'll need to add ``~/.local/bin`` to your
path to your home directory), so you'll need to add ``~/.local/bin`` to your
``PATH``. You can set your ``PATH`` permanently by `modifying ~/.profile`_.

- On Windows you can find the user base binary directory by running ``py -m
site --user-site`` and replacing ``site-packages`` with ``Scripts``. For
example, this could return
``C:\Users\Username\AppData\Roaming\Python36\site-packages`` so you would
``C:\Users\Username\AppData\Roaming\Python36\site-packages``, so you would
need to set your ``PATH`` to include
``C:\Users\Username\AppData\Roaming\Python36\Scripts``. You can set your user
``PATH`` permanently in the `Control Panel`_. You may need to log out for the
Expand All @@ -463,7 +462,7 @@ Requirements files
==================

Install a list of requirements specified in a :ref:`Requirements File
<pip:Requirements Files>`.
<pip:Requirements Files>`:

.. tab:: Unix/macOS

Expand All @@ -480,8 +479,7 @@ Install a list of requirements specified in a :ref:`Requirements File
Installing from VCS
===================

Install a project from VCS in "editable" mode. For a full breakdown of the
syntax, see pip's section on :ref:`VCS Support <pip:VCS Support>`.
Install a project from VCS in "editable" mode:

.. tab:: Unix/macOS

Expand All @@ -501,10 +499,12 @@ syntax, see pip's section on :ref:`VCS Support <pip:VCS Support>`.
py -m pip install -e SomeProject @ svn+svn://svn.repo/some_pkg/trunk/ # from svn
py -m pip install -e SomeProject @ git+https://git.repo/some_pkg.git@feature # from a branch

For a full breakdown of the syntax, see pip's section on :ref:`VCS Support <pip:VCS Support>`.

Installing from other Indexes
=============================

Install from an alternate index
Install from an alternate index:

.. tab:: Unix/macOS

Expand All @@ -519,7 +519,7 @@ Install from an alternate index
py -m pip install --index-url http://my.package.repo/simple/ SomeProject

Search an additional index during install, in addition to :term:`PyPI <Python
Package Index (PyPI)>`
Package Index (PyPI)>`:

.. tab:: Unix/macOS

Expand All @@ -540,7 +540,7 @@ Installing from a local src tree
Installing from local src in
:doc:`Development Mode <setuptools:userguide/development_mode>`,
i.e. in such a way that the project appears to be installed, but yet is
still editable from the src tree.
still editable from the src tree:

.. tab:: Unix/macOS

Expand All @@ -554,7 +554,7 @@ still editable from the src tree.

py -m pip install -e <path>

You can also install normally from src
You can also install normally from src:

.. tab:: Unix/macOS

Expand All @@ -571,7 +571,7 @@ You can also install normally from src
Installing from local archives
==============================

Install a particular source archive file.
Install a particular source archive file:

.. tab:: Unix/macOS

Expand All @@ -586,7 +586,7 @@ Install a particular source archive file.
py -m pip install ./downloads/SomeProject-1.0.4.tar.gz

Install from a local directory containing archives (and don't check :term:`PyPI
<Python Package Index (PyPI)>`)
<Python Package Index (PyPI)>`):

.. tab:: Unix/macOS

Expand All @@ -607,10 +607,10 @@ Install from a local directory containing archives (and don't check :term:`PyPI
Installing from other sources
=============================

To install from other data sources (for example Amazon S3 storage)
To install from other data sources (for example, Amazon S3 storage),
you can create a helper application that presents the data
in a format compliant with the :ref:`simple repository API <simple-repository-api>`:,
and use the ``--extra-index-url`` flag to direct pip to use that index.
in a format compliant with the :ref:`simple repository API <simple-repository-api>`
and use the ``--extra-index-url`` flag to direct pip to use that index:

.. code-block:: bash

Expand All @@ -621,8 +621,8 @@ and use the ``--extra-index-url`` flag to direct pip to use that index.
Installing Prereleases
======================

Find pre-release and development versions, in addition to stable versions. By
default, pip only finds stable versions.
Find pre-release and development versions, in addition to stable versions (by
default, pip only finds stable versions):

.. tab:: Unix/macOS

Expand Down Expand Up @@ -678,4 +678,4 @@ you know publishes one, you can include it in the pip installation command:

.. [4] The compatible release specifier was accepted in :pep:`440`
and support was released in :ref:`setuptools` v8.0 and
:ref:`pip` v6.0
:ref:`pip` v6.0.