From bf31e56e2013506aedf76e6a79257bb16f8954c4 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 19 Aug 2024 18:51:13 +0200 Subject: [PATCH] fix venv detection --- tools/idf_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/idf_tools.py b/tools/idf_tools.py index 6e155575a96a..776a4d154059 100755 --- a/tools/idf_tools.py +++ b/tools/idf_tools.py @@ -2573,7 +2573,7 @@ def action_install_python_env(args): # type: ignore reinstall = args.reinstall idf_python_env_path, _, virtualenv_python, idf_version = get_python_env_path() - is_virtualenv = hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix) + is_virtualenv = 'VIRTUAL_ENV' in os.environ if is_virtualenv and (not os.path.exists(idf_python_env_path) or reinstall): fatal('This script was called from a virtual environment, can not create a virtual environment again') raise SystemExit(1)