#报错信息
from PIL import Image
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Administrator\anaconda3\envs\segmentation\lib\site-packages\PIL\Image.py", line 103, in <module>
from . import _imaging as core
ImportError: DLL load failed: 找不到指定的模块。
需要检查以下内容:
检查所安装的 Pillow 库与操作系统、Python 版本等兼容。注意不同的操作系统有可能需要额外的配置或者不兼容某些 Pillow 版本。
检查运行时环境配置是否符合所需的依赖关系。例如,如果您使用的是 Windows 操作系统,可以从 Microsoft 官方网站下载和安装相关的 Visual Studio 运行时环境。
检查您所使用的 Python 版本是否正确。例如,如果您在 Python 3.x 上使用 Pillow,需要安装与您所使用的 Python 版本兼容的 Pillow 库。
本人是因为pillow与python版本不兼容导致的,把pillow升级到了最新版本就解决了,解决方法如下:
pip install --upgrade pillow