🐛 fix(pip): set PIP_USER=0 to prevent --user installs in virtualenvs#3719
Merged
gaborbernat merged 1 commit intotox-dev:mainfrom Feb 17, 2026
Merged
🐛 fix(pip): set PIP_USER=0 to prevent --user installs in virtualenvs#3719gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat merged 1 commit intotox-dev:mainfrom
Conversation
b68f4c6 to
bb9ad36
Compare
auto-merge was automatically disabled
February 17, 2026 02:42
Pull request was converted to draft
35e0d84 to
e63f151
Compare
When users have pip configured globally to install packages with --user (via pip config --user), pip attempts to use this inside tox virtualenvs where user site-packages aren't visible, causing installation failures. This was fixed in tox 3 but the patch was lost during the tox 4 rewrite. Fixes tox-dev#3010
649e3d9 to
eb218ec
Compare
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.
Users with
pip config --userconfigured globally experienced installation failures in tox virtualenvs. 🐛 When pip attempted to honor the--userflag inside virtualenvs, it crashed because user site-packages aren't visible in isolated environments.This regression was introduced during the tox 4 rewrite. Tox 3 correctly set
PIP_USER=0to override user configuration, but this protection was lost in the rewrite. The fix restores this behavior by setting the environment variable in all virtualenv-based Python environments.The solution follows pip's documented environment variable precedence where
PIP_USER=0explicitly disables--userinstalls regardless of config file settings. This preserves user workflows while ensuring tox virtualenvs remain isolated. ✨Fixes #3010