feat(tools): Enforce pip 'user' option to no, when installing python env

Closes https://github.com/espressif/esp-idf/issues/16189
This commit is contained in:
Marek Fiala
2025-07-02 12:36:59 +02:00
committed by BOT
parent 46b67d4674
commit 6cd12fe8dd

View File

@@ -2686,9 +2686,8 @@ def action_install_python_env(args): # type: ignore
install_legacy_python_virtualenv(idf_python_env_path) install_legacy_python_virtualenv(idf_python_env_path)
env_copy = os.environ.copy() env_copy = os.environ.copy()
if env_copy.get('PIP_USER') == 'yes': # Enforce disabling possible pip 'user' option to prevent installation error with virtual environment
warn('Found PIP_USER="yes" in the environment. Disabling PIP_USER in this shell to install packages into a virtual environment.') env_copy['PIP_USER'] = 'no'
env_copy['PIP_USER'] = 'no'
constraint_file = get_constraints(idf_version) if use_constraints else None constraint_file = get_constraints(idf_version) if use_constraints else None