Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 3 additions & 25 deletions source/guides/installing-stand-alone-command-line-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,9 @@ that is on your ``$PATH``. This allows each package to be upgraded or
uninstalled without causing conflicts with other packages, and allows you to
safely run the applications from anywhere.

.. note:: pipx only works with Python 3.6+.

pipx is installed with pip:

.. tab:: Unix/macOS

.. code-block:: bash

python3 -m pip install --user pipx
python3 -m pipx ensurepath

.. tab:: Windows

.. code-block:: bat

py -m pip install --user pipx
py -m pipx ensurepath

.. note::

``ensurepath`` ensures that the application directory is on your ``$PATH``.
You may need to restart your terminal for this update to take effect.

Now you can install packages with ``pipx install`` and run the package's
applications(s) from anywhere.
After `installing pipx <https://pipx.pypa.io/stable/how-to/install-pipx.html>`_
itself, you can then install packages with ``pipx install`` and run the
package's applications from anywhere:

.. code-block:: console

Expand Down
62 changes: 4 additions & 58 deletions source/tutorials/installing-packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ please install the latest 3.x version from `python.org`_ or refer to the
.. Note:: Due to the way most Linux distributions are handling the Python 3
migration, Linux users using the system Python without creating a virtual
environment first should replace the ``python`` command in this tutorial
with ``python3`` and the ``python -m pip`` command with ``python3 -m pip --user``. Do *not*
run any of the commands in this tutorial with ``sudo``: if you get a
permissions error, come back to the section on creating virtual environments,
set one up, and then continue with the tutorial as written.
with ``python3``. Do *not* run any of the commands in this tutorial with
``sudo``: if you get a permissions error, come back to the section on
creating virtual environments, set one up, and then continue with the
tutorial as written.

.. _getting started tutorial: https://opentechschool.github.io/python-beginners/en/getting_started.html#what-is-python-exactly
.. _python.org: https://www.python.org
Expand Down Expand Up @@ -404,60 +404,6 @@ Upgrade an already installed ``SomeProject`` to the latest from PyPI:

py -m pip install --upgrade SomeProject

.. _`Installing to the User Site`:

Installing to the User Site
===========================

To install :term:`packages <Distribution Package>` that are isolated to the
current user, use the ``--user`` flag:

.. tab:: Unix/macOS

.. code-block:: bash

python3 -m pip install --user SomeProject

.. tab:: Windows

.. code-block:: bat

py -m pip install --user SomeProject

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.

If ``SomeProject`` defines any command-line scripts or console entry points,
``--user`` will cause them to be installed inside the `user base`_'s binary
directory, which may or may not already be present in your shell's
:envvar:`PATH`. (Starting in version 10, pip displays a warning when
installing any scripts to a directory outside :envvar:`PATH`.) If the scripts
are not available in your shell after installation, you'll need to add the
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``. 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
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
``PATH`` changes to take effect.

.. _user base: https://docs.python.org/3/library/site.html#site.USER_BASE
.. _modifying ~/.profile: https://stackoverflow.com/a/14638025
.. _Control Panel: https://learn.microsoft.com/en-us/windows/win32/shell/user-environment-variables

Requirements files
==================

Expand Down
1 change: 0 additions & 1 deletion source/tutorials/managing-dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ Use ``pip`` to install Pipenv:
packages. If ``pipenv`` isn't available in your shell after installation,
you'll need to add the :py:data:`user base <python:site.USER_BASE>`'s
binary directory to your ``PATH``.
See :ref:`Installing to the User Site` for more information.

.. _npm: https://www.npmjs.com/
.. _bundler: https://bundler.io/
Expand Down