@@ -303,6 +303,7 @@ Upgrade an already installed `SomeProject` to the latest from PyPI.
303303 pip install --upgrade SomeProject
304304
305305
306+ .. _`Installing to the User Site` :
306307
307308Installing to the User Site
308309===========================
@@ -322,6 +323,32 @@ from the pip docs.
322323Note that the ``--user `` flag has no effect when inside a virtual environment
323324- all installation commands will affect the virtual environment.
324325
326+ If ``SomeProject `` defines any command-line scripts or console entry points,
327+ ``--user `` will cause them to be installed inside the `user base `_'s binary
328+ directory, which may or may not already be present in your shell's
329+ :envvar: `PATH `. (Starting in version 10, pip displays a warning when
330+ installing any scripts to a directory outside :envvar: `PATH `.) If the scripts
331+ are not available in your shell after installation, you'll need to add the
332+ directory to your :envvar: `PATH `:
333+
334+ - On Linux and macOS you can find the user base binary directory by running
335+ ``python -m site --user-base `` and adding ``bin `` to the end. For example,
336+ this will typically print ``~/.local `` (with ``~ `` expanded to the absolute
337+ path to your home directory) so you'll need to add ``~/.local/bin `` to your
338+ ``PATH ``. You can set your ``PATH `` permanently by `modifying ~/.profile `_.
339+
340+ - On Windows you can find the user base binary directory by running ``py -m
341+ site --user-site `` and replacing ``site-packages `` with ``Scripts ``. For
342+ example, this could return
343+ ``C:\Users\Username\AppData\Roaming\Python36\site-packages `` so you would
344+ need to set your ``PATH `` to include
345+ ``C:\Users\Username\AppData\Roaming\Python36\Scripts ``. You can set your user
346+ ``PATH `` permanently in the `Control Panel `_. You may need to log out for the
347+ ``PATH `` changes to take effect.
348+
349+ .. _user base : https://docs.python.org/3/library/site.html#site.USER_BASE
350+ .. _modifying ~/.profile : https://stackoverflow.com/a/14638025
351+ .. _Control Panel : https://msdn.microsoft.com/en-us/library/windows/desktop/bb776899(v=vs.85).aspx
325352
326353Requirements files
327354==================
0 commit comments