报错“SyntaxError: future feature annotations is not defined”

SyntaxError: future feature annotations is not defined

报错信息:

  File "predict.py", line 9, in 
    from PIL import Image
  File "", line 971, in _find_and_load
  File "", line 955, in _find_and_load_unlocked
  File "", line 656, in _load_unlocked
  File "", line 626, in _load_backward_compatible
  File "/home/nvidia/.local/lib/python3.6/site-packages/Pillow-9.2.0-py3.6-linux-aarch64.egg/PIL/Image.py", line 52, in 
  File "", line 971, in _find_and_load
  File "", line 951, in _find_and_load_unlocked
  File "", line 894, in _find_spec
  File "", line 1157, in find_spec
  File "", line 1131, in _get_spec
  File "", line 1112, in _legacy_get_spec
  File "", line 441, in spec_from_loader
  File "", line 544, in spec_from_file_location
  File "/home/nvidia/.local/lib/python3.6/site-packages/Pillow-9.2.0-py3.6-linux-aarch64.egg/PIL/_deprecate.py", line 1
SyntaxError: future feature annotations is not defined

怀疑是python版本和pillow的版本不匹配导致

原环境:python==3.6+pillow==9.2.0

对pillow降级变为pillow==8.4.0解决

你可能感兴趣的:(环境,python)