4
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CygwinのPythonでPILやPillowを使う

Last updated at Posted at 2015-06-16

更新履歴

2015/06/17 必要パッケージが誤っていたので修正しました。
2016/05/05 libjpeg-develについて追加

環境

Windows7+cygwin
virtualenvでPython2.7やPython3.4の環境を準備

方法

freetype2を入れて、ディレクトリのシンボリックリンクを作りました。
Python2.7にPILを入れる場合もPython3.4にPillowを入れる場合も、この方法でいけるっぽいです。

libjpeg-develも必要だったとの情報をいただきました(コメント参照)
  自分の環境では別件で入れてしまっていたかもしれません。

# 必要パッケージを入れる
apt-cyg install libfreetype6
apt-cyg install libfreetype-devel
# シンボリックリンクでfreetype2をfreetypeに見せかける
ln -s /usr/include/freetype2 /usr/include/freetype

この後、Python2.7なら

# PILを入れる
easy_install PIL

Python3.4なら

# pillowを入れる
easy_install pillow

freetype2をfreetypeに見せかけた場合の悪影響とかは不明です。
とりあえず動きました。
PILやpillowを入れ終わったらシンボリックリンク削除しておいてもよいかも?

4
6
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?