Skip to content

docs: Improve --user/--no-user documentation#13782

Open
Ashutosh0x wants to merge 3 commits intopypa:mainfrom
Ashutosh0x:feature/user-install-docs
Open

docs: Improve --user/--no-user documentation#13782
Ashutosh0x wants to merge 3 commits intopypa:mainfrom
Ashutosh0x:feature/user-install-docs

Conversation

@Ashutosh0x
Copy link

@Ashutosh0x Ashutosh0x commented Feb 1, 2026

Summary

This PR improves the documentation for the --user and --no-user install options as requested in #12924.

Changes

Documentation Updates (docs/html/user_guide.rst)

  1. Added 'Automatic User Install Fallback' section: Documents the often-surprising behavior where pip automatically falls back to a user install when site-packages is not writeable.

  2. Added '--no-user Option' section: Documents the previously hidden --no-user option and its use cases.

  3. Added 'Environment Variables' section: Documents PIP_USER for controlling user install behavior, and PYTHONUSERBASE for customizing install location.

Source Code Changes (src/pip/_internal/commands/install.py)

  1. Made --no-user visible in help: Changed from SUPPRESS_HELP to proper help text explaining the option.

News Fragment

Added
ews/12924.doc.rst documenting the changes.

Fixes

Closes #12924

Testing

  • Documentation builds correctly
  • --no-user option now shows in pip install --help

@Ashutosh0x Ashutosh0x force-pushed the feature/user-install-docs branch from 30dae2b to e676f15 Compare February 1, 2026 11:38
Comment on lines 332 to 333
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this change? Seems like noise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, why did this change?

Comment on lines 1 to 6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This news item is way too long, news items appear as bullet points in the change log. As a rule of thumb keep all news items to a short one or two sentences. For example this could just be:

Improved documentation for the ``--user`` and ``--no-user`` options.

@notatallshaw
Copy link
Member

--no-user was intentionally hidden when it was created due to concerns of behavior with --user and --no-user together, see #5116 (comment) and #5085 (comment)

I don't think we can document or this feature without making them mutually exclusive, and I don't think we can do that without warning users first, we could need to trigger a deprecation warning for two cycles if --user and --no-user are called, and then make --no-user visible, mutually exclusive with --user, and document it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better documentation on install --user/--no-user and related envvars

2 participants

Comments