1
我正在尝试使用Pillow。我已经按照本网站上的安装说明: http://www.pythonforbeginners.com/gui/how-to-use-pillowPIL在终端中工作,但不通过空闲
当我键入以下到我的终端窗口:
$ python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>>
它不给我任何错误,所以假设链接的网站是正确的这意味着枕头已正确安装。 然而,当我尝试使用PIL库从Python IDLE,像这样:
from PIL import Image
Python的给出错误信息:
Traceback (most recent call last):
File "/Sample_application.py",
line 3, in <module>
from PIL import Image
ImportError: No module named 'PIL'
我在做什么错?我正在使用mac OSX 10.9,小牛
或安装。什么'输入sys; print(sys.prefix)'在任一环境中生成? – 2014-10-11 15:53:45
哎呀,这可能是问题!在终端我得到2.7,通过IDLE我得到3.4。我该如何解决这个问题? – 2014-10-11 16:24:00
您可能会运行'/ usr/bin/idle'来运行系统安装的IDLE。或者使用'python3.4 -m pip install Pillow'将Pillow安装到Python 3.4中。 – 2014-10-11 16:38:06