导入 _imaging 时 DLL 加载失败:

nya*_*ren 6 python dll cmd matplotlib python-imaging-library

我正在尝试运行我的 Python 程序,这些是我要导入的模块:

\n
\n

from tkinter import *\nfrom functools 导入部分
\nimport numpy as np import\nmatplotlib matplotlib.use("TkAgg")
\nfrom matplotlib.figure 导入图\nfrom matplotlib.backends.backend_tkagg\nimport FigureCanvasTkAgg, NavigationToolbar2Tk

\n
\n

我总是收到以下错误消息:

\n
C:\\Users\\HP\\anaconda3\\lib\\site-packages\\numpy\\__init__.py:138: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service\n  from . import _distributor_init\nTraceback (most recent call last):\n  File "ASRS.py", line 12, in <module>\n    from matplotlib.figure import Figure\n  File "C:\\Users\\HP\\AppData\\Roaming\\Python\\Python38\\site-packages\\matplotlib\\figure.py", line 18, in <module>\n    from matplotlib import docstring, projections\n  File "C:\\Users\\HP\\AppData\\Roaming\\Python\\Python38\\site-packages\\matplotlib\\projections\\__init__.py", line 1, in <module>\n    from .. import axes, docstring\n  File "C:\\Users\\HP\\AppData\\Roaming\\Python\\Python38\\site-packages\\matplotlib\\axes\\__init__.py", line 1, in <module>\n    from ._subplots import *\n  File "C:\\Users\\HP\\AppData\\Roaming\\Python\\Python38\\site-packages\\matplotlib\\axes\\_subplots.py", line 6, in <module>\n    from matplotlib.axes._axes import Axes\n  File "C:\\Users\\HP\\AppData\\Roaming\\Python\\Python38\\site-packages\\matplotlib\\axes\\_axes.py", line 14, in <module>\n    import matplotlib.contour as mcontour\n  File "C:\\Users\\HP\\AppData\\Roaming\\Python\\Python38\\site-packages\\matplotlib\\contour.py", line 17, in <module>\n    import matplotlib.text as text\n  File "C:\\Users\\HP\\AppData\\Roaming\\Python\\Python38\\site-packages\\matplotlib\\text.py", line 16, in <module>\n    from .textpath import TextPath  # Unused, but imported by others.\n  File "C:\\Users\\HP\\AppData\\Roaming\\Python\\Python38\\site-packages\\matplotlib\\textpath.py", line 11, in <module>\n    from matplotlib.mathtext import MathTextParser\n  File "C:\\Users\\HP\\AppData\\Roaming\\Python\\Python38\\site-packages\\matplotlib\\mathtext.py", line 27, in <module>\n    from PIL import Image\n  File "C:\\Users\\HP\\anaconda3\\lib\\site-packages\\PIL\\Image.py", line 94, in <module>\n    from . import _imaging as core\n**ImportError: DLL load failed while importing _imaging: Belirtilen mod\xc3\xbcl bulunamad\xc4\xb1.**\n
Run Code Online (Sandbox Code Playgroud)\n

我怎样才能解决这个问题?

\n

Hag*_*ard 21

只需升级“Pillow”包就可以解决这个问题。因此,要么

pip install --upgrade Pillow
Run Code Online (Sandbox Code Playgroud)

或者

conda update Pillow
Run Code Online (Sandbox Code Playgroud)

应该可以解决问题(取决于您的环境)。