{"id":9819,"library":"huggingface","title":"Hugging Face (Meta-package)","description":"The `huggingface` PyPI package (version 0.0.1) is a meta-package designed to simplify installation by pulling in the main Hugging Face libraries: `transformers`, `datasets`, and `huggingface_hub`. It does not provide its own direct API functionality. This package typically has a very low release cadence, primarily updating its dependencies.","status":"active","version":"0.0.1","language":"en","source_language":"en","source_url":"https://github.com/huggingface/huggingface","tags":["meta-package","huggingface","nlp","ml","install"],"install":[{"cmd":"pip install huggingface","lang":"bash","label":"Install `huggingface` and its dependencies"}],"dependencies":[{"reason":"Provides state-of-the-art machine learning models for NLP, computer vision, and audio.","package":"transformers","optional":false},{"reason":"Offers an efficient way to access and share datasets for machine learning.","package":"datasets","optional":false},{"reason":"Client library for interacting with the Hugging Face Hub (model/dataset storage and sharing).","package":"huggingface_hub","optional":false}],"imports":[{"note":"The `huggingface` package itself does not expose an API; functionality comes from its sub-libraries like `transformers`.","wrong":"from huggingface import pipeline","symbol":"pipeline","correct":"from transformers import pipeline"},{"note":"For dataset management, import directly from the `datasets` library.","wrong":"from huggingface import Dataset","symbol":"Dataset","correct":"from datasets import Dataset"},{"note":"For interacting with the Hugging Face Hub, use the `huggingface_hub` client.","wrong":"from huggingface import HfApi","symbol":"HfApi","correct":"from huggingface_hub import HfApi"}],"quickstart":{"code":"from transformers import pipeline\n\n# The huggingface meta-package itself does not provide an API.\n# This quickstart demonstrates typical usage of the `transformers` library,\n# which is installed as a dependency by `huggingface`.\n\nclassifier = pipeline(\"sentiment-analysis\")\nresult = classifier(\"I love using Hugging Face libraries!\")\nprint(result)\n\n# Example of using a dataset (also installed by huggingface meta-package)\nfrom datasets import load_dataset\n# dataset = load_dataset(\"imdb\") # Uncomment to load a large dataset\n# print(dataset)\n","lang":"python","description":"The `huggingface` package itself does not expose an API. This quickstart demonstrates common usage of the `transformers` library (specifically the `pipeline` abstraction), which is automatically installed as a dependency by `huggingface`. All direct functionality will come from `transformers`, `datasets`, or `huggingface_hub`."},"warnings":[{"fix":"Always import classes and functions directly from `transformers`, `datasets`, or `huggingface_hub`, not `huggingface`.","message":"The `huggingface` PyPI package is a meta-package (version 0.0.1) and does not provide direct API functionality. It primarily serves to install other core Hugging Face libraries (`transformers`, `datasets`, `huggingface_hub`).","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Identify which specific Hugging Face library provides the desired functionality (e.g., `transformers` for `pipeline`, `datasets` for `Dataset`) and import from that package.","message":"Attempting to import or use functionality directly from `huggingface` (e.g., `from huggingface import pipeline`) will result in an `AttributeError` or `ModuleNotFoundError`.","severity":"gotcha","affected_versions":"0.0.1"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Functionality like `pipeline` resides in the `transformers` library. Change your import to `from transformers import pipeline`.","cause":"Trying to import a function/class like `pipeline` directly from the `huggingface` meta-package.","error":"AttributeError: module 'huggingface' has no attribute 'pipeline'"},{"fix":"The core libraries (`transformers`, `datasets`, `huggingface_hub`) are installed as separate, top-level packages. You should import from them directly, e.g., `from transformers import AutoModel`.","cause":"Incorrectly assuming that the `huggingface` meta-package establishes a hierarchical module structure like `huggingface.models` or `huggingface.datasets`.","error":"ModuleNotFoundError: No module named 'huggingface.models'"}]}