mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
force upgrade of conda itself
if conda upgrade conda is broken, we are in trouble this is required to avoid the RemoveError
This commit is contained in:
@@ -98,7 +98,7 @@ def install_miniconda(installer_path, prefix):
|
||||
fix_permissions(prefix)
|
||||
|
||||
|
||||
def ensure_conda_packages(prefix, packages):
|
||||
def ensure_conda_packages(prefix, packages, force=False):
|
||||
"""
|
||||
Ensure packages (from conda-forge) are installed in the conda prefix.
|
||||
|
||||
@@ -110,13 +110,16 @@ def ensure_conda_packages(prefix, packages):
|
||||
# fallback on conda if mamba is not present (e.g. for mamba to install itself)
|
||||
conda_executable = os.path.join(prefix, "bin", "conda")
|
||||
|
||||
cmd = [conda_executable, "install", "--yes"]
|
||||
|
||||
if force:
|
||||
cmd += ["--force"]
|
||||
|
||||
abspath = os.path.abspath(prefix)
|
||||
|
||||
utils.run_subprocess(
|
||||
[
|
||||
conda_executable,
|
||||
"install",
|
||||
"-y",
|
||||
cmd
|
||||
+ [
|
||||
"-c",
|
||||
"conda-forge", # Make customizable if we ever need to
|
||||
"--prefix",
|
||||
|
||||
Reference in New Issue
Block a user