ImportError: cannot import name 'PILLOW_VERSION' 

1. 问题:import torchvision时出现错误:ImportError: cannot import name 'PILLOW_VERSION' 

2. 参考:https://blog.****.net/ternence_hsu/article/details/103821264https://yunyaniu.blog.****.net/article/details/103895753

3. 解决:

  • 版本过高,Pillow的最新版本没有此函数或方法。版本降低到7.0.0 版本以下就可以了,在 7.0.0 后的版本没有 PILLOW_VERSION 这个值。
  • 使用命令:pip install Pillow==6.2.2   (安装6.2.2版本后,再import torchvision,就没错误了,问题解决!)

4. 过程如下图所示:

ImportError: cannot import name 'PILLOW_VERSION' 

 ImportError: cannot import name 'PILLOW_VERSION'