Skip to content

Commit fcaaf74

Browse files
authored
Merge pull request #2214 from konstin/konsti/dont-use-user-site
Stop recommending user site packages
2 parents 01ea1c4 + 64a2f30 commit fcaaf74

3 files changed

Lines changed: 7 additions & 84 deletions

File tree

‎source/guides/installing-stand-alone-command-line-tools.rst‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,9 @@ that is on your ``$PATH``. This allows each package to be upgraded or
2020
uninstalled without causing conflicts with other packages, and allows you to
2121
safely run the applications from anywhere.
2222

23-
.. note:: pipx only works with Python 3.6+.
24-
25-
pipx is installed with pip:
26-
27-
.. tab:: Unix/macOS
28-
29-
.. code-block:: bash
30-
31-
python3 -m pip install --user pipx
32-
python3 -m pipx ensurepath
33-
34-
.. tab:: Windows
35-
36-
.. code-block:: bat
37-
38-
py -m pip install --user pipx
39-
py -m pipx ensurepath
40-
41-
.. note::
42-
43-
``ensurepath`` ensures that the application directory is on your ``$PATH``.
44-
You may need to restart your terminal for this update to take effect.
45-
46-
Now you can install packages with ``pipx install`` and run the package's
47-
applications(s) from anywhere.
23+
After `installing pipx <https://pipx.pypa.io/stable/how-to/install-pipx.html>`_
24+
itself, you can then install packages with ``pipx install`` and run the
25+
package's applications from anywhere:
4826

4927
.. code-block:: console
5028

‎source/tutorials/installing-packages.rst‎

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ please install the latest 3.x version from `python.org`_ or refer to the
8383
.. Note:: Due to the way most Linux distributions are handling the Python 3
8484
migration, Linux users using the system Python without creating a virtual
8585
environment first should replace the ``python`` command in this tutorial
86-
with ``python3`` and the ``python -m pip`` command with ``python3 -m pip --user``. Do *not*
87-
run any of the commands in this tutorial with ``sudo``: if you get a
88-
permissions error, come back to the section on creating virtual environments,
89-
set one up, and then continue with the tutorial as written.
86+
with ``python3``. Do *not* run any of the commands in this tutorial with
87+
``sudo``: if you get a permissions error, come back to the section on
88+
creating virtual environments, set one up, and then continue with the
89+
tutorial as written.
9090

9191
.. _getting started tutorial: https://opentechschool.github.io/python-beginners/en/getting_started.html#what-is-python-exactly
9292
.. _python.org: https://www.python.org
@@ -404,60 +404,6 @@ Upgrade an already installed ``SomeProject`` to the latest from PyPI:
404404
405405
py -m pip install --upgrade SomeProject
406406
407-
.. _`Installing to the User Site`:
408-
409-
Installing to the User Site
410-
===========================
411-
412-
To install :term:`packages <Distribution Package>` that are isolated to the
413-
current user, use the ``--user`` flag:
414-
415-
.. tab:: Unix/macOS
416-
417-
.. code-block:: bash
418-
419-
python3 -m pip install --user SomeProject
420-
421-
.. tab:: Windows
422-
423-
.. code-block:: bat
424-
425-
py -m pip install --user SomeProject
426-
427-
For more information, see the `User Installs
428-
<https://pip.pypa.io/en/latest/user_guide/#user-installs>`_ section
429-
from the pip docs.
430-
431-
Note that the ``--user`` flag has no effect when inside a virtual environment
432-
– all installation commands will affect the virtual environment.
433-
434-
If ``SomeProject`` defines any command-line scripts or console entry points,
435-
``--user`` will cause them to be installed inside the `user base`_'s binary
436-
directory, which may or may not already be present in your shell's
437-
:envvar:`PATH`. (Starting in version 10, pip displays a warning when
438-
installing any scripts to a directory outside :envvar:`PATH`.) If the scripts
439-
are not available in your shell after installation, you'll need to add the
440-
directory to your :envvar:`PATH`:
441-
442-
- On Linux and macOS you can find the user base binary directory by running
443-
``python -m site --user-base`` and adding ``bin`` to the end. For example,
444-
this will typically print ``~/.local`` (with ``~`` expanded to the absolute
445-
path to your home directory), so you'll need to add ``~/.local/bin`` to your
446-
``PATH``. You can set your ``PATH`` permanently by `modifying ~/.profile`_.
447-
448-
- On Windows you can find the user base binary directory by running ``py -m
449-
site --user-site`` and replacing ``site-packages`` with ``Scripts``. For
450-
example, this could return
451-
``C:\Users\Username\AppData\Roaming\Python36\site-packages``, so you would
452-
need to set your ``PATH`` to include
453-
``C:\Users\Username\AppData\Roaming\Python36\Scripts``. You can set your user
454-
``PATH`` permanently in the `Control Panel`_. You may need to log out for the
455-
``PATH`` changes to take effect.
456-
457-
.. _user base: https://docs.python.org/3/library/site.html#site.USER_BASE
458-
.. _modifying ~/.profile: https://stackoverflow.com/a/14638025
459-
.. _Control Panel: https://learn.microsoft.com/en-us/windows/win32/shell/user-environment-variables
460-
461407
Requirements files
462408
==================
463409

‎source/tutorials/managing-dependencies.rst‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ Use ``pip`` to install Pipenv:
5252
packages. If ``pipenv`` isn't available in your shell after installation,
5353
you'll need to add the :py:data:`user base <python:site.USER_BASE>`'s
5454
binary directory to your ``PATH``.
55-
See :ref:`Installing to the User Site` for more information.
5655

5756
.. _npm: https://www.npmjs.com/
5857
.. _bundler: https://bundler.io/

0 commit comments

Comments
 (0)