【发布时间】:2017-09-02 05:25:53
【问题描述】:
这是对我所做工作的描述。
我正在尝试使用 PIL 编写程序,但是在尝试导入它时(如下所示),出现错误(也如下所示)。
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.
我尝试过简单的import Image:
但是,它也显示错误:
Here is the error to the second situation.
Traceback (most recent call last):
File "C:/Users/user/Desktop/Wook/Test Bench.py", line 1, in <module>
import Image
ModuleNotFoundError: No module named 'Image'
以下是我为解决该问题而尝试做的一个非常简短的列表:
- 正在安装 PIL(找不到满足 PIL 要求的版本(来自版本:)没有找到 PIL 的匹配发行版),我只想说,它不起作用;
- 正在卸载 PIL,但我无法卸载我未安装的内容(无法卸载要求 PIL,未安装);
- 我试过安装枕头,但是已经安装好了;
- 我试图卸载枕头(然后重新安装,看看它是否会工作),它没有解决任何问题。
这就是我所尝试的。如果有人可以帮助我,我们将不胜感激,如果需要提供任何进一步的信息,可以并且将会提供。
【问题讨论】:
-
查找错误。我发现专门针对 PIL 的唯一内容是:stackoverflow.com/q/33697743/5827958,但我不确定这会对您有所帮助。不过,还有很多其他模块存在相同的问题,因此您可能会从中得到一些想法。
-
你在 Python3 上吗?安装pypi.python.org/pypi/Pillow
-
@Claudio,我已经安装了 Pillow。它不起作用。谢谢你,仍然。
-
在我的盒子上:
>>> Image.__file__ '/usr/lib/python2.7/dist-packages/PILcompat/Image.pyc'所以在你的盒子上搜索Image.pyc,然后确保 Python 在其搜索路径中有这个模块:stackoverflow.com/questions/3144089/…
标签: python python-3.x python-imaging-library