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