导入PIL,更具体地说是从PIL导入图像,不起作用

时间:2017-04-07 00:16:57

标签: python python-3.x python-imaging-library

以下是我所做的事情的描述。

我正在尝试使用PIL编写程序,但是,当尝试导入它时(如下图所示),会出现错误(也如下所示)。

HAVING
        MAX(CASE code WHEN 'ND' THEN 1 END) = 1
    AND MAX(CASE code WHEN 'IL' THEN 1 END) = 1

Here is the error.

from PIL import Image

我试过简单地Traceback (most recent call last): File "C:/Users/user/Desktop/Wook/Test Bench.py", line 1, in <module> from PIL import Image File "C:\Python\lib\site-packages\PIL\Image.py", line 56, in <module> from . import _imaging as core ImportError: DLL load failed: The specified procedure could not be found.

但是,它也会显示错误:

Here is the error to the second situation.

import Image

以下是我尝试解决此问题的简短列表:

  • 安装PIL(找不到满足要求PIL的版本(来自版本:)没有找到匹配的PIL分发),足以说明,它不起作用;
  • 卸载PIL,但我无法卸载我没有安装的内容(无法卸载需求PIL,未安装);
  • 我试过安装枕头,但它已经安装好了;
  • 我试图卸下枕头(然后重新安装它,看它是否会起作用),它没有解决问题。

这就是我尝试过的。如果有人可以帮助我,我们将非常感激,如果需要提供任何进一步的信息,它可以并且将会被提供。

1 个答案:

答案 0 :(得分:4)

Python问题意味着针对Python 3.6.1构建的轮子,例如Pillow 4.1.0,不能在Python 3.6.0上运行。

修复是更新到Python 3.6.1,或者安装Pillow 4.0.0(它是针对Python 3.6.0构建的)。

有关详细信息,请参阅: https://github.com/python-pillow/Pillow/issues/2479 https://mail.python.org/pipermail/python-dev/2017-March/147707.html https://bugs.python.org/issue29943

更新:

这影响了许多Python库。

然而,新的Pillow 4.1.1版本可以解决这个问题,因此您现在可以更新到Pillow 4.1.1并将其与Python 3.6.0和3.6.1一起使用。

相关问题