---
title: 'Hugging Face'
url: 'https://mcavdar.com/blog/hugging-face'
markdown: 'https://mcavdar.com/blog/hugging-face.md'
date: '2025-06-06'
description: 'Getting Started setup with Python virtual environment You can verify the installation by running: >>> import transformers I would like to list some common issues: Issues >>> import transformers Traceback (most recent call last): File "<stdin>", line 1, in <module> M…'
taxonomy:
  tag:
    - huggingface
    - python
    - issue
    - nlp
---

## [Hugging Face](https://mcavdar.com/blog/hugging-face)

    6th Jun 2025   [huggingface](https://mcavdar.com/tag:huggingface#body-wrapper) [python](https://mcavdar.com/tag:python#body-wrapper) [issue](https://mcavdar.com/tag:issue#body-wrapper) [nlp](https://mcavdar.com/tag:nlp#body-wrapper)  

![](https://huggingface.co/front/assets/huggingface_logo-noborder.svg)

# Getting Started

setup with [Python virtual environment](https://huggingface.co/learn/nlp-course/chapter0/1#using-a-python-virtual-environment)

You can verify the installation by running:

```
>>> import transformers
```

I would like to list some common issues:

# Issues

- ```
    >>> import transformers
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'transformers'
    ```

It looks like your installation was not successful or you didn't activate the virtual environment.

- ```
    >>> from transformers import pipeline
    ...
    ... classifier = pipeline("sentiment-analysis")
    ... classifier("I've been waiting for a HuggingFace course my whole life.")
    ...
    [transformers] PyTorch was not found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
    [transformers] PyTorch was not found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
    [transformers] No model was supplied, defaulted to distilbert/distilbert-base-uncased-finetuned-sst-2-english and revision 714eb0f.
    Using a pipeline without specifying a model name and revision in production is not recommended.
    Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
    config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 629/629 [00:00<00:00, 2.73MB/s]
    Traceback (most recent call last):
    File "<python-input-0>", line 3, in <module>
    classifier = pipeline("sentiment-analysis")
    File "/home/mc/.venv-transformers/lib/python3.13/site-packages/transformers/pipelines/__init__.py", line 1024, in pipeline
    if isinstance(dtype, str) and hasattr(torch, dtype):
                                          ^^^^^
    NameError: name 'torch' is not defined
    ```

    To fix the issue install Pytorch.
- ```
    untimeError: At least one of TensorFlow 2.0 or PyTorch should be installed. To install TensorFlow 2.0, read the instructions at https://www.tensorflow.org/install/ To install PyTorch, read the instructions at https://pytorch.org/.
    ```

    To fix the issue install tensorflow with `pip install tensorflow==2.14.0` as well.
- ```
    Could not find cuda drivers on your machine, GPU will not be used.
    ```
- ```
    This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
    To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
    ```
- ```
    TF-TRT Warning: Could not find TensorRT
    ```

 [Next Post ](https://mcavdar.com/blog/crawl4ai-in-action-real-world-use-cases-for-smarter-web-scraping)

#### Syndicate

 [ Atom 1.0](https://mcavdar.com/blog.atom) [ RSS](https://mcavdar.com/blog.rss)

---

## Navigation

- Parent: [Blog](https://mcavdar.com/index.md)
- Previous: [Crawl4AI in Action: Real-World Use Cases for Smarter Web Scraping](https://mcavdar.com/blog/crawl4ai-in-action-real-world-use-cases-for-smarter-web-scraping.md)
