安装枕头,但“没有模块命名枕头”- python2.7 - Windows 7 - python -m安装枕头

时间:2022-11-21 00:23:49

Using python 2.7 on Windows 7 installed package pillow with

在Windows 7上使用python 2.7安装包枕

python -m pip install pillow

Got success message (Successfully installed pillow). Closed and re-opened cmd terminal.

收到成功消息(成功安装枕头)。关闭并重新打开cmd终端。

But when I try to

但是当我尝试的时候

import pillow

I get the error message

我得到了错误信息

ImportError: No module named pillow

If python -m pip install pillow is run again, it says

如果python -m pip安装枕头再次运行,它说

Requirement already satisfied (use --upgrade to upgrade): pillow in c:\python27\lib\site-packages

1 个解决方案

#1


28  

Try using

试着用

import PIL

or

from PIL import ...

instead. Pillow is a fork of PIL, the Python Imaging Library, which is no longer maintained. However, to maintain backwards compatibility, the old module name is used.

代替。Pillow是PIL的分支,Python映像库,不再被维护。但是,为了保持向后兼容性,使用旧的模块名。

#1


28  

Try using

试着用

import PIL

or

from PIL import ...

instead. Pillow is a fork of PIL, the Python Imaging Library, which is no longer maintained. However, to maintain backwards compatibility, the old module name is used.

代替。Pillow是PIL的分支,Python映像库,不再被维护。但是,为了保持向后兼容性,使用旧的模块名。