Old note The removal of python-gnome2 (and anything that relies on it) is necessary apparently because some "selectors" have not yet been converted. The right thing to do here is to fix the selectors rather than removing the package.'

You can also run Gramps 4.0+ in Python 3 first Install the Python BSDDB interface and check that it works

sudo apt-get install python3-bsddb3

You will probably want these optional packages:

sudo apt-get install python-pygoocanvas gir1.2-goocanvas-2.0-9

For additional functionality, install these:

sudo apt-get install python-pyexiv2

Ubuntu 12.04

For people on Ubuntu 12.04, you need:

1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:
gnome_shell pppa
Then upgrade your system via the system manager.

Note 1 : If you use Gnome3, also add the gnome3 ppa!

Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!

2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:

Debian Testing

As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.4.2-2. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:

KDE

To set the theme, open gramps, and open System settings -> Application Appearance -> GTK+ Appearance, and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.

Spell Check Install

(In Ubuntu 12.10, the libgtkspell-3-0 package is not suitable [7] as it is API incompatible with the official release 3.0.0, released on 2012-11-12 )

If the package is not in your distributions packages, you need to compile the spell check. For this, obtain the GtkSpell 3.3.0 or later source code, and extract the code to a directory, eg gtkspell3, and go into this directory using the terminal.

Before continuing, remove any old version of gtkspell v3 you might have installed before!

Gtkspell working on gramps40 - You can tell because it does not recognise the word Gramps in the welcome Gramplet

Install your Dictionary

If your language is missing from the list of dictionaries to spellcheck against you can install them.

eg: For Australian English:

sudo apt-get install myspell-en-au

You can check that the language installed correctly by running

enchant-lsmod -list-dicts

The result should list all the language dictionaries installed and include the one you installed
eg:
en_AU (myspell)

Old install method

we need a patched gtkspell version that supports gobject introspection. A working version is the changes branch at https://github.com/manisandro/gtkspell3/tree/changes. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [8] and a redhat bug entry: [9]

To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Using the latter, you can start Gramps in trunk with:

First sets library to /usr/local/lib so as to find osmgpsmap and gtkspell, second /usr/local/lib/python2.7/site-packages/ to find the local install of pygobject

GExiv2 for Image metadata

As at 9 Mar 2013 Fedora 18 only has a libgexiv2-0.4.1-3.fc18.i686.rpm. and
version 0.5 (released October 2012) is needed in order to have the Python
bindings for GExiv2.

The GExiv2 maintainer's homepage is: redmine.yorba.org/projects/gexiv2/wiki
which points to the latest sources, and tells you how to compile it.

But to compile a Fedora 18 GExiv2 library, you need to have installed both
exiv2-devel-0.23-3.fc18.i686.rpm and exiv2-libs-0.23-3.fc18.i686.rpm also.
And you also need (unless you already have the /usr/bin/g-ir-scanner program)
gobject-introspection-devel-1.34.2-1.fc18.i686.rpm too -- but that requires
pkgconfig (which I already had) and also libffi-devel-3.0.10-3.fc18.i686.rpm
for it to be happy.

The 0.5 GExiv2 sources are in www.yorba.org/download/gexiv2/0.5. There you
can download "libgexiv2-0.5.0.tar.xz" (not .bz2 or .gz) -- which will again
only be necessary if Fedora has not yet updated its official RPM (to 0.5).

Then, make a temporary directory and copy libgexiv2-0.5.0.tar.xz into it.
Then "cd" into that directory and say "tar xpfJ libgexiv2-0.5.0.tar.xz".
Then "cd" into the "libgexiv2-0.5.0" it made, and type:

./configure --enable-introspection --prefix=/usr
make

(with the "/usr" being needed to override the "/usr/local" default)

Then say (as root):

make install

Since I already had Python3 installed on that F18, along with the Python2
which came with the F18, the "make install" put GExiv2.py into both the
python2.7 and python3.3 site-packages/gi/overrides directories, thus enabling
it on both. If you only have one Python it will put it only there.

As a test, in both (for me) "python" and "python3" say:

from gi.repository import GExiv2

Let's not tell users that they should install self-built software into /usr. They shouldn't, and neither should you.
Either /usr/local or /opt are better choices and more-or-less standard practice. To make the library findable one
should either add the directory of choice to /etc/ld.so.conf and run ldconfig(8) or add it to $LD_LIBRARY_PATH in one's profile.

Problems

If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.

Open

We cannot set strings in struct, see GTK bug [11] It seems we can do without this, so not an issue at the moment

No rows_reordered function on treemodels in python, see GTK bug [12]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.

Geography : missing tiles : osm-gps-map problem.

(Gramps.py:4515): OsmGpsMap-WARNING **: Error getting missing tile

Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)

Geography : We cannot mix osmgpsmap between trunk and gramps34 and others.

Solved or workaround

there are some drag and drop issues: [13], [14]. Solved: Use set_target_list functions for drag and drop with a created TargetList.

error in list_families on textview in styledtexteditor: [15]. Workaround: we use a global function that calls this once as workaround. There is a fix upstream.

str and unicode no longer seem to work, the encoding must be passed too; Future: deprecate unicode() in the code, as we want to support python 3' - SOLVED FOR NOW: added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?

there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.

glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - Solved: Although our catalog cannot be opened, we can use glade with undefined elements without issues.

menu.popup does not seem to work in some instances. Solved: Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example

Many Gtk elements no longer grab certain events. Solved: Add a Gtk.EventBox under them to grab the event.

This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree built with debugging CFLAGS (-g -O0). At a minimum, in addition to Python itself, you'll need symbols for Gtk+ (libgtk-3.0.so and libgdk-3.0.so), PyGObject, and GLib.

To see the python stack:

(gdb) pystack

This works with gdb7 as-is; for earlier versions, you need to install gdbinit as .gdbinit in your home directory before starting gdb.
On some systems (MacOS X in particular), the structure PyStringObject isn't exported in the debug symbols, so if you get the error