Repository navigation
Stop recommending user site packages - #2214
Merged
Merged
Conversation
User site packages may not be writable anymore with PEP 668, as it is the case on my system (see below). User site packages also don't provide isolation of packages against each other and can get into an inconsistent state. We should not advertise `--user` to users. This PR removes the section that recommends using them. I've left the `pip install --user` Pipenv section since it matches https://github.com/pypa/pipenv#installation. Pipenv likely needs to adopt a recommendation similar to the one from pipx (https://pipx.pypa.io/stable/how-to/install-pipx.html#linux) ``` $ pip install --user tqdm error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed. See /usr/share/doc/python3.14/README.venv for more information. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. ```
rgommers
reviewed
Nov 29, 2026
rgommers
left a comment
Contributor
There was a problem hiding this comment.
Thanks @konstin, this is a useful cleanup, --user is discouraged and should not be recommended in this guide. This LGTM, there's one little leftover that I commented on inline that should be cleaned up before merging.
In addition, I found two more places that --user should be cleaned up. That can be done in this PR or left for later, up to you:
- In
source/guides/installing-stand-alone-command-line-tools.rstforpipx, the install command can be replaced with a link to https://pipx.pypa.io/stable/how-to/install-pipx.html, which will be more concise and already has up-to-date guidance. - In this same tutorial, there is a mention left for
--userin the note on line 83. That should instead say that if you're on Linux, don't usesudobut create a virtual environment.
Contributor
Author
|
Good idea, done. |
rgommers
added this pull request to the merge queue
Nov 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User site packages may not be writable anymore with PEP 668, as it is the case on my system (see below). User site packages also don't provide isolation of packages against each other and can get into an inconsistent state. We should not advertise
--userto users (uv doesn't implement support for it at all for those reasons). This PR removes the section that recommends using them.I've left the
pip install --userPipenv section since it matches https://github.com/pypa/pipenv#installation. Pipenv likely needs to adopt a recommendation similar to the one from pipx (https://pipx.pypa.io/stable/how-to/install-pipx.html#linux)AI usage disclosure
I used Codex for Git and formattings. Text edits are mine.
📚 Documentation preview 📚: https://python-packaging-user-guide--2214.org.readthedocs.build/en/2214/