ImportError: cannot import name 'logging' from 'huggingface_hub'

Hi All,

While importing the transformers library in python (3.10.12) I am getting the below error.
I am simply running the below code and encountering the error

import transformers

Error stack:

[15] from .dependency_versions_table import deps

[6] from … import constants, logging
[7] from . import build_hf_headers, get_session, hf_raise_for_status
[10] logger = logging.get_logger(name)
ImportError: cannot import name ‘logging’ from ‘huggingface_hub’

I know import errors are common for Beginners, but so far have not found anything in the forums. I have updated the transformers library to the latest version as well but that did not help.
I would really appreciate it if someone can provide some hints/pointers as to how to solve this issue.

Thanks in advance!

2 Likes