ImportError: packaging>=20.0 is required for a normal functioning of this mo

from transformers import BasicTokenizer

时,报错ImportError: packaging>=20.0 is required for a normal functioning of this mo..
经查setuptools 58.2.0 太高了,降到19.2 或 42.0即可 。
故:
在anaconda3中进入对应的虚拟环境:

pip install setuptools==42.0

再重新安装一次transformers

pip install --user -I transformers --no-cache-dir --force-reinstall

OK,问题解决~

你可能感兴趣的:(python,开发语言)