From 07e9fb58f64482dcc5ff6ebe2854fd4d70073e8d Mon Sep 17 00:00:00 2001 From: Samson Yeung Date: Thu, 29 Sep 2022 12:56:22 -0700 Subject: [PATCH] Avoid a specific case where `conda env update` hangs. (#11818) When using an environment.yml that asks pip to clone a git repo and that path exists, pip will ask for user input. As we are not in a context to provide such, tell pip what to do so it doesn't hang on waiting for user input. --- conda_env/installers/pip.py | 3 ++- news/11818-conda-hang | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 news/11818-conda-hang diff --git a/conda_env/installers/pip.py b/conda_env/installers/pip.py index ae882bff53f..aa259a91c45 100644 --- a/conda_env/installers/pip.py +++ b/conda_env/installers/pip.py @@ -48,7 +48,8 @@ def _pip_install_via_requirements(prefix, specs, args, *_, **kwargs): requirements.write('\n'.join(specs)) requirements.close() # pip command line... - pip_cmd = ['install', '-U', '-r', requirements.name] + # see https://pip.pypa.io/en/stable/cli/pip/#exists-action-option + pip_cmd = ['install', '-U', '-r', requirements.name, '--exists-action=b'] stdout, stderr = pip_subprocess(pip_cmd, prefix, cwd=pip_workdir) finally: # Win/Appveyor does not like it if we use context manager + delete=True. diff --git a/news/11818-conda-hang b/news/11818-conda-hang new file mode 100644 index 00000000000..57976e57aaf --- /dev/null +++ b/news/11818-conda-hang @@ -0,0 +1,21 @@ +### Enhancements + +* + +### Bug fixes + +* `conda env update` would ask for user input and hang when working with pip +installs of git repos and the repo was previously checked out. Tell pip not to +ask for user input for that case. (#11818) + +### Deprecations + +* + +### Docs + +* + +### Other + +*