'Why aren't transformers imported in Python?

I want to import transformers in jupyter notebook but I get the following error. What is the reason for this error? My Python version is 3.8

ImportError: cannot import name 'TypeAlias' from 'typing_extensions'

I also updated the typing-extensions library version, but the problem was not resolved



Solution 1:[1]

You could try

pip install typing-extensions --upgrade

Solution 2:[2]

maybe the probelm is the version of datasets package: pip install datasets==1.15

Solution 3:[3]

TypeAlias is available from python version 3.10. You should upgrade your python version to avoid the error.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ida Marie
Solution 2 Eric Yee
Solution 3 sixtfile