From f96b44ec6a0e47d5e0d55bcd800227cbac55c7f9 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Sun, 11 Feb 2024 20:40:35 +0100 Subject: [PATCH] try to remove all just in case --- conda_pip/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conda_pip/main.py b/conda_pip/main.py index 2de82f8..5d076fd 100644 --- a/conda_pip/main.py +++ b/conda_pip/main.py @@ -193,6 +193,8 @@ def ensure_target_env_has_externally_managed(command: str): if list(prefix_data.query("pip")): # leave in place if pip is still installed return - next(get_externally_managed_path(target_prefix)).unlink() + for path in get_externally_managed_path(target_prefix): + if path.exists(): + path.unlink() else: raise ValueError(f"command {command} not recognized.")