Python使用Pillow包报错 ImportError: DLL load failed while importing

Python使用Pillow包报错 ImportError: DLL load failed while importing,第1张

Python使用Pillow包报错 ImportError: DLL load failed while importing

        最近使用Python调用Pillow时报错,代码就两行:

from PIL import Image

print("PyCharm")

报错如下:

Traceback (most recent call last):
  File "C:UsersAdministratorPycharmProjectspythonProjectmain.py", line 5, in
    from PIL import Image
  File "D:Pythonlibsite-packagesPILImage.py", line 94, in
    from . import _imaging as core
importError: DLL load failed while importing _imaging: 找不到指定的程序。

Python版本:3.9.0,Pillow:8.4.0

 解决方法:安装旧版Python,我安装的是3.8.2

 再次编译运行,不报错了。

D:Python38python.exe C:/Users/Administrator/PycharmProjects/pythonProject/main.py
PyCharm

进程已结束,退出代码为 0

困扰了我一天多的问题,在这里写一下,希望帮帮有需要的人。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5592936.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存