Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Python2 does not suffer the same problem.

greg@greg-precise:~$ python3

Python 3.2.3 (default, May  3 2012, 15:51:42) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> from gi.repository import Gtk

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named gi.repository

(line breaks added for clarity)

share|improve this question
up vote 10 down vote accepted

You should install the correct Python 3 packages, these are prepended with python3- instead of python- .

This will do the trick:

sudo apt-get install python3-gi

Or search this package in your favorite package manager.

share|improve this answer
Also be aware that everything you wish to use may not have all the necessary pieces to use from Python 3 available in the 12.04 packaging. Some libraries have special Python overrides which need to be installed in the Python 3 directories for python3-gi to use those bindings properly. – dobey Jul 3 '12 at 13:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.