2016-12-26 20 views
6

PILをインストールしようとしましたが、エラーが発生しました。どうすればよいですか?PILをインストールしようとするとエラーが発生します

$ Command 
Result 
------------ 
$ pip install PIL 

Collecting PIL 
    Could not find a version that satisfies the requirement PIL (from versions:) 
No matching distribution found for PIL 
-------------------------------------------------------------------- 
$ pip install PIL --allow-unverified PIL --allow-all-external 

DEPRECATION: --allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect. 
DEPRECATION: --allow-unverified has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect. 
Collecting PIL 
    Could not find a version that satisfies the requirement PIL (from versions:) 
No matching distribution found for PIL 
+0

どのようなシステムですか? Linux Mintでは 'python-pil'や' python-pillow'をインストールするために 'apt-get'を使うことができます – furas

答えて

18

あなたはPILフォークである、代わりにPillowを使用して試みることができる:

pip install Pillow 

を使用をインポートするには:

from PIL import Image 
+0

これは機能します。ありがとうございました! – Shira

0

これよりも良い方法があるかどうかはわかりません。しかし、これはドキュメントに記載されているように動作します:

http://www.pythonware.com/products/pil/

ソースキットをダウンロードして抽出します。抽出したら、キットに記載されているように以下を行ってください。

$ tar xvfz Imaging-1.1.7.tar.gz 
    $ cd Imaging-1.1.7 
    $ python setup.py install 
+0

ファイルから_imagingtk.c:19: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX 。プラットフォーム/デベロッパー/ SDK/MacOSX10.11.sdk/usr/include/tk.h:78:11:致命的なエラー: 'X11/Xlib.h'ファイルが見つかりません。#を含む ^ 1エラーが生成されました。 エラー:終了ステータス1でコマンド 'cc'に失敗しました。 – Shira

+0

ここで解決している問題があるかどうか確認してください。 http://stackoverflow.com/questions/11465258/xlib-h-not-found-when-building-graphviz-on-mac-os-x-10-8-mountain-lion –

0

ライブラリPILPillowです。試してみてください:

関連する問題