exceptions#

Conda exceptions.

Functions#

format_env_spec_available_plugins(plugin_specs[, ...])

maybe_raise(error, context)

_get_errors(exc_val) → collections.abc.Iterable[BaseException]

Yield non-container errors, flattening nested ``CondaMultiError``s.

_get_guidance(error) → conda._private.exception_guidance.ErrorGuidance | None

Combine core guidance with plugin hints for a leaf CondaError.

_format_leaf_errors(leaves) → str

Format each leaf error for human output with its own guidance.

_json_error_map(error) → dict[str, Any]

Build JSON error map with print-time guidance (leaf errors only).

print_conda_exception(exc_val[, exc_tb])

_format_exc([exc_val, exc_tb])

Attributes#

UnsatisfiableConflictEntry#
exception ResolvePackageNotFound(bad_deps: collections.abc.Iterable[collections.abc.Iterable[conda.models.match_spec.MatchSpec]])#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

bad_deps#
_formatted_chains#
exception LockError(message: str)#

Bases: conda.CondaError, OSError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception ArgumentError(message: str, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

return_code = 2#
exception Help(message: str | None, *args: Any, caused_by: Any = None, guidance: _private.exception_guidance.ErrorGuidance | _private.exception_guidance.ErrorGuidanceTypedDict | None = None, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

return_code = 0#
exception ActivateHelp#

Bases: Help

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception DeactivateHelp#

Bases: Help

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception GenericHelp(command: str)#

Bases: Help

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaSignalInterrupt(signum: int)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception TooManyArgumentsError(expected: int, received: int, offending_arguments: collections.abc.Iterable[str], optional_message: str = '', *args)#

Bases: ArgumentError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

expected#
received#
offending_arguments#
optional_message = ''#
exception ClobberError(message: str, path_conflict: conda.base.constants.PathConflict, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

path_conflict#
__repr__()#

Return repr(self).

exception BasicClobberError(source_path: conda.common.path.PathType, target_path: conda.common.path.PathType, context: conda.base.context.Context)#

Bases: ClobberError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception KnownPackageClobberError(target_path: conda.common.path.PathType, colliding_dist_being_linked: conda.models.records.PackageRecord | str, colliding_linked_dist: conda.models.records.PackageRecord | str, context: conda.base.context.Context)#

Bases: ClobberError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception UnknownPackageClobberError(target_path: conda.common.path.PathType, colliding_dist_being_linked: conda.models.records.PackageRecord | str, context: conda.base.context.Context)#

Bases: ClobberError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception SharedLinkPathClobberError(target_path: conda.common.path.PathType, incompatible_package_dists: collections.abc.Iterable[conda.models.records.PackageRecord | str], context: conda.base.context.Context)#

Bases: ClobberError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CommandNotFoundError(command: str)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception PathNotFoundError(path: conda.common.path.PathType)#

Bases: conda.CondaError, OSError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception DirectoryNotFoundError(path: conda.common.path.PathType)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentLocationNotFound(location: conda.common.path.PathType)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentNameNotFound(environment_name: str)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception NoBaseEnvironmentError#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception DirectoryNotACondaEnvironmentError(target_directory: conda.common.path.PathType)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaEnvironmentError(message: str, *args)#

Bases: conda.CondaError, OSError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception DryRunExit#

Bases: conda.CondaExitZero

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaSystemExit(*args)#

Bases: conda.CondaExitZero, SystemExit

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception PaddingError(dist: str, placeholder: str, placeholder_length: int)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception LinkError(message: str, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception LinkSourceNotFoundError(src: str, **kwargs)#

Bases: conda.CondaError

Raised when the source of a link does not exist.

Carries the missing src path so callers can remediate without parsing the error message. Unlike PathNotFoundError, the source is expected to be an already-extracted package file, so a missing source usually points at a corrupt package cache entry to clean up.

Raised by create_link(), which is not package-cache specific, so the conda clean --packages advice in the message does not fit every caller.

Initialize self. See help(type(self)) for accurate signature.

src#
exception LinkScriptError(message: str, action: str, prec: conda.models.records.PackageRecord, path: str, **kwargs)#

Bases: LinkError

Raised when a pre-link or post-link script exits non-zero.

Carries structured information about the failure (the script's action, the prec it ran for and the path of the script) so callers can dispatch on the type and fields instead of parsing the message.

Failing unlink scripts only log a warning and report failure by returning False, so action is always "pre-link" or "post-link".

Initialize self. See help(type(self)) for accurate signature.

action#
prec#
path#
exception CondaOSError(message: str, **kwargs)#

Bases: conda.CondaError, OSError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception ProxyError(message: str | None = None)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaIOError(message: str, *args)#

Bases: conda.CondaError, OSError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaFileIOError(filepath: conda.common.path.PathType, message: str, *args)#

Bases: CondaIOError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

filepath#
exception CondaKeyError(key: Any, message: str, *args)#

Bases: conda.CondaError, KeyError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

key#
msg#
exception ChannelError(message: str | None, *args: Any, caused_by: Any = None, guidance: _private.exception_guidance.ErrorGuidance | _private.exception_guidance.ErrorGuidanceTypedDict | None = None, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception ChannelNotAllowed(channel: conda.models.channel.Channel)#

Bases: ChannelError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

warning = 'Channel not included in allowlist'#
exception ChannelDenied(channel: conda.models.channel.Channel)#

Bases: ChannelNotAllowed

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

warning = 'Channel included in denylist'#
exception UnavailableInvalidChannel(channel: conda.models.channel.Channel | str, status_code: str | int, response: requests.models.Response | None = None, shards_only_hint: bool = False)#

Bases: ChannelError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

status_code: str | int#
exception OperationNotAllowed(message: str)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaImportError(message: str)#

Bases: conda.CondaError, ImportError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception ParseError(message: str)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CouldntParseError(reason: str)#

Bases: ParseError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

reason#
exception ChecksumMismatchError(url: str, target_full_path: conda.common.path.PathType, checksum_type: str, expected_checksum: str, actual_checksum: str, partial_download: bool = False)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaHTTPError(message: str, url: str, status_code: int | str, reason: str, elapsed_time: datetime.timedelta | str, response: requests.Response | None = None, caused_by: Any = None)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaSSLError(message: str | None, *args: Any, caused_by: Any = None, guidance: _private.exception_guidance.ErrorGuidance | _private.exception_guidance.ErrorGuidanceTypedDict | None = None, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception AuthenticationError(message: str | None, *args: Any, caused_by: Any = None, guidance: _private.exception_guidance.ErrorGuidance | _private.exception_guidance.ErrorGuidanceTypedDict | None = None, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception PackagesNotFoundError(packages: collections.abc.Iterable[conda.models.match_spec.MatchSpec | conda.models.records.PackageRecord | str], channel_urls: collections.abc.Iterable[str] = ())#

Bases: conda.CondaError

Base error for missing packages.

Prefer raising one of the more specific subclasses:

Initialize self. See help(type(self)) for accurate signature.

packages#
channel_urls = ()#
exception PackagesNotFoundInChannelsError(packages: collections.abc.Iterable[conda.models.match_spec.MatchSpec | conda.models.records.PackageRecord | str], channel_urls: collections.abc.Iterable[str])#

Bases: PackagesNotFoundError

The requested packages are not available from the configured channels.

Initialize self. See help(type(self)) for accurate signature.

exception PackageNotInstalledError(prefix: conda.common.path.PathType, package_name: str | collections.abc.Iterable[conda.models.match_spec.MatchSpec | conda.models.records.PackageRecord | str])#

Bases: PackagesNotFoundError

The requested package(s) are missing from the target environment/prefix.

Initialize self. See help(type(self)) for accurate signature.

exception PackagesNotFoundInPrefixError(packages: collections.abc.Iterable[conda.models.match_spec.MatchSpec | conda.models.records.PackageRecord | str], prefix: conda.common.path.PathType)#

Bases: PackageNotInstalledError

The requested package(s) are missing from the target environment/prefix.

This is a backwards-compatible alias for PackageNotInstalledError.

Initialize self. See help(type(self)) for accurate signature.

exception NoChannelsConfiguredError(packages: collections.abc.Iterable[str] = ())#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception UnsatisfiableError(bad_deps: UnsatisfiableConflictMap, chains: bool = True, strict: bool = False)#

Bases: conda.CondaError

Raised when dependency constraints cannot be satisfied.

Parameters:
  • bad_deps -- Classified resolver conflicts, or empty when hints are off.

  • chains -- Unused; retained for call-site compatibility.

  • strict -- Whether strict channel priority was in effect.

Initialize self. See help(type(self)) for accurate signature.

_format_chain_str(bad_deps: list[list[str]]) → list[str]#
unsatisfiable = []#
_get_guidance(bad_deps: UnsatisfiableConflictMap, strict: bool = False) → conda._private.exception_guidance.ErrorGuidanceTypedDict | None#

Build guidance dict for UnsatisfiableError, or None.

exception RemoveError(message: str, *, guidance: conda._private.exception_guidance.ErrorGuidance | conda._private.exception_guidance.ErrorGuidanceTypedDict | None = None)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception DisallowedPackageError(package_ref: conda.models.records.PackageRecord, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception SpecsConfigurationConflictError(requested_specs: collections.abc.Iterable[conda.models.match_spec.MatchSpec], pinned_specs: collections.abc.Iterable[conda.models.match_spec.MatchSpec], prefix: conda.common.path.PathType)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaIndexError(message: str)#

Bases: conda.CondaError, IndexError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaValueError(message: str, *args, **kwargs)#

Bases: conda.CondaError, ValueError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception PlatformMismatchError(incompatible: collections.abc.Iterable[tuple[str, collections.abc.Iterable[str]]], subdir: str)#

Bases: CondaValueError

Raised when one or more environment specs do not cover the requested platform.

The message is derived from a list of (source, available_platforms) pairs so the wording stays consistent whether the failure comes from a single file (conda create, conda update) or several (Environment.from_cli with multiple -f / --file arguments).

Initialize self. See help(type(self)) for accurate signature.

exception CyclicalDependencyError(packages_with_cycles: collections.abc.Iterable[conda.models.records.PackageRecord], **kwargs)#

Bases: conda.CondaError, ValueError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CorruptedEnvironmentError(environment_location: conda.common.path.PathType, corrupted_file: conda.common.path.PathType, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaHistoryError(message: str)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaUpgradeError(message: str)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaVerificationError(message: str)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception SafetyError(message: str)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaMemoryError(caused_by: Any, **kwargs)#

Bases: conda.CondaError, MemoryError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception NotWritableError(path: conda.common.path.PathType, errno: int, **kwargs)#

Bases: conda.CondaError, OSError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

errno#
exception NoWritableEnvsDirError(envs_dirs: collections.abc.Iterable[conda.common.path.PathType], **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception NoWritablePkgsDirError(pkgs_dirs: collections.abc.Iterable[conda.common.path.PathType], **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentIsFrozenError(prefix: conda.common.path.PathType, message: str = '', **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentNotWritableError(environment_location: conda.common.path.PathType, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaDependencyError(message: str)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception BinaryPrefixReplacementError(path: conda.common.path.PathType, placeholder: str, new_prefix: conda.common.path.PathType, original_data_length: int, new_data_length: int)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception InvalidSpec(message: str, **kwargs)#

Bases: conda.CondaError, ValueError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception InvalidVersionSpec(invalid_spec: str | conda.models.match_spec.MatchSpec, details: str)#

Bases: InvalidSpec

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception InvalidMatchSpec(invalid_spec: str | conda.models.match_spec.MatchSpec, details: str)#

Bases: InvalidSpec

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EncodingError(caused_by: Any, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception NoSpaceLeftError(caused_by: Any, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaEnvException(message: str, *args, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentFileInvalid(msg: str, *args, **kwargs)#

Bases: CondaEnvException

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentFileNotFound(filename: conda.common.path.PathType, *args, **kwargs)#

Bases: CondaEnvException

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

filename#
exception EnvironmentFileExtensionNotValid(filename: conda.common.path.PathType, *args, **kwargs)#

Bases: CondaEnvException

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

filename#
exception EnvironmentFileTypeMismatchError(file_types: dict[str, str], *args, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentFileEmpty(filename: conda.common.path.PathType, *args, **kwargs)#

Bases: CondaEnvException

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

filename#
exception EnvironmentFileNotDownloaded(username: str, packagename: str, *args, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

username#
packagename#
exception PluginError(message: str | None, *args: Any, caused_by: Any = None, guidance: _private.exception_guidance.ErrorGuidance | _private.exception_guidance.ErrorGuidanceTypedDict | None = None, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception SpecNotFound(msg: str, *args, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

format_env_spec_available_plugins(plugin_specs: list[conda.plugins.types.CondaEnvironmentSpecifier], formats_header: str = 'Available formats', indent: int = 4, cmd_suggestion: bool = True)#
exception AmbiguousEnvironmentSpecPlugin(msg: str, plugins: list[conda.plugins.types.CondaEnvironmentSpecifier], *args, **kwargs)#

Bases: PluginError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentSpecPluginSelectionError(msg: str, plugin_specs: list[conda.plugins.types.CondaEnvironmentSpecifier], *args, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentSpecPluginNotDetected(plugin_specs: list[conda.plugins.types.CondaEnvironmentSpecifier], *args, **kwargs)#

Bases: SpecNotFound

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception EnvironmentExporterNotDetected(filename: str, exporters: collections.abc.Iterable[conda.plugins.types.CondaEnvironmentExporter], *args, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

filename#
exception SpecNotFoundInPackageCache(msg: str, *args, **kwargs)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

maybe_raise(error: BaseException, context: conda.base.context.Context)#
_get_errors(exc_val: BaseException) → collections.abc.Iterable[BaseException]#

Yield non-container errors, flattening nested ``CondaMultiError``s.

_get_guidance(error: conda.CondaError) → conda._private.exception_guidance.ErrorGuidance | None#

Combine core guidance with plugin hints for a leaf CondaError.

_format_leaf_errors(leaves: collections.abc.Iterable[BaseException]) → str#

Format each leaf error for human output with its own guidance.

_json_error_map(error: BaseException) → dict[str, Any]#

Build JSON error map with print-time guidance (leaf errors only).

print_conda_exception(exc_val: conda.CondaError, exc_tb: types.TracebackType | None = None)#
_format_exc(exc_val: BaseException | None = None, exc_tb: types.TracebackType | None = None)#
exception InvalidInstaller(name: str, *, file: str | None = None)#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception OfflineError(message: str | None, *args: Any, caused_by: Any = None, guidance: _private.exception_guidance.ErrorGuidance | _private.exception_guidance.ErrorGuidanceTypedDict | None = None, **kwargs)#

Bases: conda.CondaError, RuntimeError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception CondaUpdatePackageError(spec: str | list[str])#

Bases: conda.CondaError

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.