LoginSignup
1
0

More than 5 years have passed since last update.

Macのvirtualenvでgexiv2を使えるようにする

Last updated at Posted at 2016-06-09

追記

2016/8/31現在、私の環境では下記の方法でセットアップすることができない状態です。動作確認の段階で、

ImportError: When using gi.repository you must not import static modules like "gobject".

という例外が発生します。原因は不明です。

私の環境

  • MacOS 10.11.5
  • Python 2.7.6

virtualenvを作成する

  • 今回は~/test/envに作成したとします。
cd ~/test
virtualenv env

pygobject、exiv2、gexiv2をインストールする

brew install pygobject3
brew install exiv2
brew install gexiv2

virtualenvとリンク

cd ~/test/env/lib/python2.7/site-packages
ln -s /usr/local/lib/python2.7/site-packages/gi gi

テストする

import gi
gi.require_version('GExiv2', '0.10')
from gi.repository import GExiv2
metadata = GExiv2.Metadata()

以上です。

1
0
0

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
1
0