Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install GExiv2 on a virtualenv?

I installed this library with:

sudo apt-get install libexiv2-dev libgexiv2-2 gir1.2-gexiv2-0.4

And I was able to load the Python module:

from gi.repository import GExiv2

The problem comes with virtualenv. I need to use this library inside a virtualenv and I don't know how to install it, since there is no pip package for this.

I tried to make a symbolic link between the system wide installed library and the virtualenv lib folder with no results:

lrwxrwxrwx 1 dnavarro dnavarro   25 jul  4 15:42 girepository-1.0 -> /usr/lib/girepository-1.0

Thanks for your help!

like image 327
Diego Navarro Avatar asked Jul 04 '13 13:07

Diego Navarro


2 Answers

Ok, I was looking a better solution, but finally I made a symbolic link inside my virtualenv lib directory and it imports GExiv2 without errors :

$ cd virtualenv
$ cd lib/python2.7/
$ ln -s /usr/lib/python2.7/dist-packages/gi
like image 71
Diego Navarro Avatar answered Oct 12 '22 05:10

Diego Navarro


I use mkvirtualenv from virtualenvwrapper package to create virtual environments. The --system-site-packages option links the public packages installed on the system to the new virtual environment.

like image 34
Atis Avatar answered Oct 12 '22 05:10

Atis