:py:mod:`requirements` ====================== .. py:module:: conda.env.specs.requirements .. autoapi-nested-parse:: Define requirements.txt spec. Classes ------- .. autoapisummary:: conda.env.specs.requirements.RequirementsSpec .. py:class:: RequirementsSpec(filename: str | None = None, **kwargs) Bases: :py:obj:`conda.plugins.types.EnvironmentSpecBase` Reads dependencies from requirements files (including explicit files) and returns an Environment object from it. Initialize the requirements specification. :param filename: Path to the requirements file :param kwargs: Additional arguments .. py:attribute:: msg :type: str | None :value: None .. py:attribute:: filename :value: None .. py:method:: can_handle() -> bool Validates that this spec can process the environment definition. This checks if: * a filename was provided * the file exists * the file content is valid for this specifier type :return: True if the file can be handled, False otherwise .. py:property:: env :type: conda.models.environment.Environment Build an environment from the requirements file. :return: An Environment object containing the package specifications :raises ValueError: If the file cannot be read