{"record":{"id":"02c3cfe26499602d","repo":"chroma-core/chroma","slug":"the-httpx-python-package-is-not-installed-please-02c3cf","errorCode":null,"errorMessage":"The httpx python package is not installed. Please install it with `pip install httpx`","messagePattern":"The httpx python package is not installed\\. Please install it with `pip install httpx`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/utils/embedding_functions/huggingface_embedding_function.py","lineNumber":33,"sourceCode":"    def __init__(\n        self,\n        api_key: Optional[str] = None,\n        model_name: str = \"sentence-transformers/all-MiniLM-L6-v2\",\n        api_key_env_var: str = \"CHROMA_HUGGINGFACE_API_KEY\",\n    ):\n        \"\"\"\n        Initialize the HuggingFaceEmbeddingFunction.\n\n        Args:\n            api_key_env_var (str, optional): Environment variable name that contains your API key for the HuggingFace API.\n                Defaults to \"CHROMA_HUGGINGFACE_API_KEY\".\n            model_name (str, optional): The name of the model to use for text embeddings.\n                Defaults to \"sentence-transformers/all-MiniLM-L6-v2\".\n        \"\"\"\n        try:\n            import httpx\n        except ImportError:\n            raise ValueError(\n                \"The httpx python package is not installed. Please install it with `pip install httpx`\"\n            )\n\n        if api_key is not None:\n            warnings.warn(\n                \"Direct api_key configuration will not be persisted. \"\n                \"Please use environment variables via api_key_env_var for persistent storage.\",\n                DeprecationWarning,\n            )\n        if os.getenv(\"HUGGINGFACE_API_KEY\") is not None:\n            self.api_key_env_var = \"HUGGINGFACE_API_KEY\"\n        else:\n            self.api_key_env_var = api_key_env_var\n\n        self.api_key = api_key or os.getenv(self.api_key_env_var)\n        if not self.api_key:\n            raise ValueError(\n                f\"The {self.api_key_env_var} environment variable is not set.\"","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/utils/embedding_functions/huggingface_embedding_function.py#L15-L51","documentation":"Error \"The httpx python package is not installed. Please install it with `pip install httpx`\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/utils/embedding_functions/huggingface_embedding_function.py:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}