install#

Conda package installation logic.

Core logic for conda [create|install|update|remove] commands.

See conda.cli.main_create, conda.cli.main_install, conda.cli.main_update, and conda.cli.main_remove for the entry points into this module.

Classes#

Functions#

validate_prefix_exists(→ None)

Validate that we are receiving at least one valid value for --name or --prefix.

validate_new_prefix(→ str)

Ensure that the new prefix does not exist.

check_prefix(prefix[, json])

clone(src_arg, dst_prefix[, json, quiet, index_args])

print_activate(env_name_or_prefix)

get_revision(arg[, json])

get_index_args(→ dict[str, any])

Returns a dict of args required for fetching an index

validate_install_command(prefix[, command])

Executes a set of validations that are required before any installation

ensure_update_specs_exist(prefix, specs)

Checks that each spec that is requested as an update exists in the prefix

install_clone(args, parser)

Executes an install of a new conda environment by cloning.

install(args, parser[, command])

Logic for conda install, conda update, conda remove, and conda create.

install_revision(args, parser)

Install a previous version of a conda environment

revert_actions(prefix[, revision, index])

handle_txn(unlink_link_transaction, prefix, args, newenv)

Attributes#

stderrlog#
validate_prefix_exists(prefix: str | pathlib.Path) None#

Validate that we are receiving at least one valid value for --name or --prefix.

validate_new_prefix(dest: str, force: bool = False) str#

Ensure that the new prefix does not exist.

check_prefix(prefix: str, json=False)#
clone(src_arg, dst_prefix, json=False, quiet=False, index_args=None)#
print_activate(env_name_or_prefix)#
get_revision(arg, json=False)#
get_index_args(args) dict[str, any]#

Returns a dict of args required for fetching an index :param args: The args provided by the cli :returns: dict of index args

class TryRepodata(notify_success, repodata, last_repodata, index_args, allowed_errors)#
__enter__()#
__exit__(exc_type, exc_value, traceback)#
class Repodatas(repodata_fns, index_args, allows_errors=())#
__iter__()#
succeed()#
validate_install_command(prefix: str, command: str = 'install')#

Executes a set of validations that are required before any installation command is executed. This includes:

  • ensure the configuration is valid

  • ensuring the user in not an admin

  • ensure the user is not forcing 32bit installs in the root prefix

Parameters:
  • prefix -- The prefix where the environment will be created

  • command -- Type of operation being performed

Raises:

error if the configuration for the install is bad

ensure_update_specs_exist(prefix: str, specs: list[str])#

Checks that each spec that is requested as an update exists in the prefix

Parameters:
  • prefix -- The target install prefix

  • specs -- List of specs to be updated

Raises:
install_clone(args, parser)#

Executes an install of a new conda environment by cloning.

install(args, parser, command='install')#

Logic for conda install, conda update, conda remove, and conda create.

install_revision(args, parser)#

Install a previous version of a conda environment

revert_actions(prefix, revision=-1, index=None)#
handle_txn(unlink_link_transaction, prefix, args, newenv, remove_op=False)#