我想在python中使用图像,但是当我尝试使用PIL时出现错误。我想使用以下命令从PIL导入图像:
from PIL import Image
但是我收到以下错误:
Traceback (most recent call last):
File "<pyshell#15>", line 1, in <module>
from PIL import Image
File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\PIL\Image.py", line 56, in <module>
from . import _imaging as core
ImportError: DLL load failed: A megadott eljárás nem található.
(最后一句话翻译为'无法找到指定的程序')
我按照this question下的说明并卸载了Pillow 4.1.0并重新安装了Pillow 4.0.0。它没有解决我的问题,但现在我得到一个不同的错误信息:
Warning (from warnings module):
File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\PIL\Image.py", line 74
# Explanations for ways that we know we might have an import error
RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL
Traceback (most recent call last):
File "<pyshell#19>", line 1, in <module>
from PIL import Image
File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\PIL\Image.py", line 58, in <module>
raise ImportError("The _imaging extension was built for another "
ImportError: The _imaging extension was built for another version of Pillow or PIL
按照另一个问题的说明我卸载了PIL(但是因为它没有安装在第一位而失败了),然后卸载了枕头,然后重新安装了枕头(最新版本),但我仍然收到第二条错误消息。
我使用的是Windows 8.1和python 3.6.0。有人知道如何解决这个问题吗?