:py:mod:`install` ================= .. py:module:: conda.cli.install .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: conda.cli.install.TryRepodata conda.cli.install.Repodatas Functions --------- .. autoapisummary:: conda.cli.install.reinstall_packages conda.cli.install.clone conda.cli.install.get_revision conda.cli.install.get_index_args conda.cli.install.validate_install_command conda.cli.install.ensure_update_specs_exist conda.cli.install.install conda.cli.install.install_clone conda.cli.install.install_revision conda.cli.install.revert_actions conda.cli.install.handle_txn .. py:function:: reinstall_packages(args, specs: list[str], **kwargs) -> int Reinstall packages using conda install. Helper for health fixes that need to reinstall packages. :param args: Parsed arguments namespace :param specs: Package specs to reinstall :param kwargs: Override default install options (e.g., force_reinstall=True) .. py:function:: clone(src_arg, dst_prefix, json=False, quiet=False, index_args=None) .. py:function:: get_revision(arg, json=False) .. py:function:: 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 .. py:class:: TryRepodata(notify_success, repodata, last_repodata, index_args, allowed_errors) .. py:attribute:: notify_success .. py:attribute:: repodata .. py:attribute:: last_repodata .. py:attribute:: index_args .. py:attribute:: allowed_errors .. py:method:: __enter__() .. py:method:: __exit__(exc_type, exc_value, traceback) .. py:class:: Repodatas(repodata_fns, index_args, allows_errors=()) .. py:attribute:: repodata_fns .. py:attribute:: index_args .. py:attribute:: success :value: False .. py:attribute:: allowed_errors .. py:method:: __iter__() .. py:method:: succeed() .. py:function:: 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 :param prefix: The prefix where the environment will be created :param command: Type of operation being performed :raises error if the configuration for the install is bad: .. py:function:: ensure_update_specs_exist(prefix: str, specs: list[str]) Checks that each spec that is requested as an update exists in the prefix :param prefix: The target install prefix :param specs: List of specs to be updated :raises CondaError: if there is an invalid spec provided :raises PackageNotInstalledError: if the requested specs to install don't exist in the prefix .. py:function:: install(args, parser, command='install') Logic for `conda install`, `conda update`, and `conda create`. .. py:function:: install_clone(args, parser) Executes an install of a new conda environment by cloning. .. py:function:: install_revision(args, parser) Install a previous version of a conda environment .. py:function:: revert_actions(prefix, revision=-1, index: conda.core.index.Index | None = None) .. py:function:: handle_txn(unlink_link_transaction, prefix, args, newenv, remove_op=False, defer_json_success=False, confirm=True) -> dict | None Handles executing an unlink_link_transaction, and reporting changes. If `defer_json_success` argument is provided, will return a dict of actions that have been taken as part of the transaction. :param unlink_link_transaction: transaction to execute, output from the solver :param prefix: prefix to execute the transaction on :param args: cli args :param newenv: boolean noting that the environment is being created for the first time :param remove_op: defaults to false, boolean noting that the user is requesting to remove a package from the environment :param defer_json_success: when true, will return the set of actions executed in dict form :param confirm: defaults to true; when false, skip the transaction summary and the confirmation prompt