gpt4 book ai didi

python - 无法从 PIL 导入 PILLOW_VERSION

转载 作者:行者123 更新时间:2023-12-04 13:36:01 24 4
gpt4 key购买 nike

导入时,Python (Anaconda) 给出以下错误:

ImportError: cannot import name 'PILLOW_VERSION' from 'PIL'
我尝试删除 pillow然后 conda install但错误仍然存​​在。

最佳答案

枕头 7.0.0 已移除 PILLOW_VERSION , 你应该使用 __version__而是在您自己的代码中。

  • https://pillow.readthedocs.io/en/stable/deprecations.html#pillow-version-constant


  • 编辑(2020-01-16):

    如果使用 torchvision,此问题已在 v0.5.0 中修复.修理:
  • 需要torchvision>=0.5.0
  • 如果 Pillow 被暂时固定,请移除针脚


  • 旧信息(2020-01-09):

    如果使用 torchvision,本周(2020 年第 2 周)计划发布一个版本来修复它:
  • https://github.com/pytorch/vision/issues/1712#issuecomment-570286349

  • 选项包括:
  • 等待新的torchvision 发布
  • 使用torchvision 的主版本(例如pip install -U git+https://github.com/pytorch/vision )
  • 从 nightly 版安装 torchvision,这也需要从 nightly 版
  • 安装 pytorch
  • 或安装 Pillow<7 (例如 pip install "pillow<7" )
  • 关于python - 无法从 PIL 导入 PILLOW_VERSION,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59659146/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com