How to resolve the hugging face error ImportError: cannot import name 'is_tokenizers_available' from 'transformers.utils'?

@Nick00243 @ewainwright

is_tokenizers_availableis looking for the tokenizerspkg:

According to the requirements, you would need a specific version (>=0.21,<0.22) of the tokenizerspkg:

Also, the import is done here (for reference):

Idk why there is an ImportError, but it seems that the tokenizers is not correctly installed or uses the wrong version. tokenizers is an extra defined in the dependencies:

… and should be installed along with transformers:

As an idea, if you have transformers already installed (but please test this in a separate env first if it works for you):

With pip, you could try to force-reinstall transformers (this should include the tokenizers extra):

1 Like