Run Gramps40 for Windows from source using Python 2.7.3

From Gramps
Revision as of 23:50, 27 October 2022 by Patsyblefebre (talk | contribs) (Clear stub template from locked old page in support of
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Work in progress!!

Nobody guarantees anything at all!
Any comments and help (e.g. on wiki pages) are welcome.

Last update: 19.01.2014

Work in progress!!

This page provides information how to run Gramps 4.0.x to 4.1.x from source on a Microsoft Windows system with a 32 bit Python 2.7.6 (and Python 3.2 or greater).

The principles are still OK. For a time without an AIO package that was a good way to have a running Gramps for Windows using Python 2.7.3. But the now available AIO package has a better usability. To prevent two different versions no further actions where done since the beginning of 2014.

Please note: Gramps 4.2.x and newer only work with Python 3.2 or greater.

There are some parts marked as:

  • "TODO ISSUE" because of known issues.
  • "TODO WORK" because it's not done yet done (work in progress).

Windows operating system


Requirements from the Gramps README:

  • Python 2.7 or greater, Python 3.2 or greater (python version cannot be mixed)
    • We use: Python 2.7.6 32 bit from (python-2.7.6.msi) for all examples assumed to be installed into "C:\Python27".
    • Comment: It's also possible to use Python 2.7.3 or 2.7.5 but always 32 bit (no experiences for 64 bit versions)
    • Comment: For Win7 user it's easier to not use "C:\Program Files (x86)\..." because for every change somewhere in this folder one has to activate the administrator's rights again and again.

PyGI AIO Package

With the help of an open source programmer we get this package (here again the authors personally thank for his good job supporting Gramps in this way - see there to know more about of his other work:

  • 19.01.2014: Download pygi-aio-3.10.2-win32_rev15-setup.exe or newer as a complete installer from:
  • The PyGI AIO Package includes the following libraries for Gramps that should be selected during the installation process (you may choose libraries other for additional usages):
    • gdk-pixbuf (version 2.30.2 in pygi-aio-3.10.2-win32_rev15-setup.exe)
    • libgexiv2 (version 0.7.0 in pygi-aio-3.10.2-win32_rev15-setup.exe)
    • goocanvas (version 2.0.2 in pygi-aio-3.10.2-win32_rev15-setup.exe)
    • gtk+ (version 3.10.6 in pygi-aio-3.10.2-win32_rev15-setup.exe)
    • gtkspell (version 3.0.3 in pygi-aio-3.10.2-win32_rev15-setup.exe)
    • osm-gps-map (version 1.0.1 in pygi-aio-3.10.2-win32_rev15-setup.exe)
    • pango (version 1.36.1 in pygi-aio-3.10.2-win32_rev15-setup.exe)
    • webkitgtk (version 1.10.2 in pygi-aio-3.10.2-win32_rev15-setup.exe)
  • To run Gramps there is no need for pygi-aio's optionally provided developer tools.
  • Don't use the older GTK 3.8.6 (Select "No" as answer at the additional question dialogue!)
  • Deprecated versions before 15.12.2013 see history

Comments (19.01.2014):

  • All gtk binaries are included in the pygi-aio installer package and correctly placed.
  • The pygi-aio package has no need for processors having an SSSE3 instruction set.

Gtk, pyobject

Requirements from README:

  • GTK 3.8.7+ or greater
  • pygobject 3.3.2 or greater
  • cairo, pango, pangocairo with introspection bindings (the gi packages)
  • librsvg2 (svg icon view)
  • xdg-utils

Checking the state of the pygi-aio package can be confirmed by:

  • starting Python (e. g.: C:\Python27>python)
  • and than call the functions as follows. There should be the same results.
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win 
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gtk
>>> Gtk.get_major_version()
>>> Gtk.get_minor_version()
>>> Gtk.get_micro_version()
>>> from gi.repository import GObject
>>> GObject.pygobject_version
(3, 10, 2)



  • Translation of GTK elements to your language, with xx your language code eg for Dutch you need language-pack-gnome-nl. The translation of the Gramps strings is included with the source code.

The necessary package related to our GTK package will be provided also by the programmer of the GTK package (see above).

  • 19.01.2014: No further actions necessary, because this GTK package contains also these components.
  • Deprecated versions before 11.03.2013 see history



==> osmgpsmap is an optional package even the README requires "strongly recommended".

Add this package:

  • 19.01.2014: osmgpsmap is integrated part of the GTK package.


  • If you don't have osmgpsmap there will be no message during the start-up of Gramps about a missing osmgpsmap. The only thing is the missing Geographic view in Gramps.
  • There is a warning from the provider of this package: "window resizing crashed". But it seems this doesn't happens for Gramps - may be in rare cases only.


Is an optional package. 19.01.2014: GExiv2 is integrated part of the GTK package.

Because the EditExifMetadata add-on isn't currently available this package is tested for reading exif data only using the "image metadata" gramplet.


Requirements from README (optional package):

  • Enable spell checking in the notes.
  • Gtkspell depends on enchant.
  • A version of gtkspell with gobject introspection is needed, so minimally version 3.0.0.

19.01.2014: The basics to use a spell are already included in the here used GTK package.

At least the content of pygi-aio-3.10.2-win32_rev15-setup.exe used by Gramps forces an crash if libenchant_voikko.dll is available!
It is strongly requested to delete ...\Lib\site-packages\gnome\lib\enchant\libenchant_voikko.dll.

The only missed things may be special myspell dictionaries (comment: Gramps uses myspell only!) . These can be found here:

  • from download the language packages of your choice. Included in the there provided .oxt files one can extract by using a program like 7-Zip the necessary .aff and .dic files.
  • alternate
  • Or you may find these files (.aff and .dic) as part of any GrampsAIO installation in "..\share\enchant\myspell"

For our example all files *.aff *.dic have to be stored into "C:\Python27\Lib\site-packages\gnome\share\enchant\myspell".

TODO ISSUE/WORK There are still some issues using spell (as per 019.01.2014):

  • Open the note editor having spell activated slows down the os extremely as longer as larger the text. This may cost more than 45 seconds for a text having 400 lines and 17000 characters. So it's strongly suggested to don't global activate "Enable spelling checker" in Preferences!
  • Up to Gramps 4.0.2 there is a spell related issue #7339 which has to be prevented by the there provided patch!


Information from README:

  • GObject introspection data of WebKit is required for the hidden view 'Htmlview', which allows websites to be opened in Gramps.
  • Users can unhide the view in the plugin manager.
  • A html renderer must be installed to use the view.
  •  !! PACKAGERS, Test if on your distribution webkit and Gramps is stable. If you obtain crashes, patch src/plugins/view/ and src/plugins/view/, so as to remove: from gi.repository import WebKit as webkit

19.01.2014: Webkit is an integrated part of the GTK package.


Information from README:

  • Required for the Graphview plugin

19.01.2014: It's is part of the current GTK package

Not Provided by GTK-AIO package



19.01.2014: Download (This zip provides ICU/PyICU version 1.5 (for current version information see )

  • Copy all files from\lib\site-packages to "C:\Python27\Lib\site-packages"
  • Now we have to place the binaries from\bin to a folder found by Python / Gramps:
    • First Option: Somewhere on hard disc e.g. "C:\icu". In this case we have to add this path to the environment variable PATH.
    • Second Option: Into the same folder as python.exe. That's a good solution for a package, because we don't need any changes for the environment variable PATH. If you don't know, where to put dll (you get an "ImportError: DLL load failed" error), put a *.dll in a "C:\Python27\Lib\site-packages" (without a bin subfolder).

To check ICU/PyICU just try it in Python (don't forget the environment variable PATH):

Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win
Type "help", "copyright", "credits" or "license" for more information.
>>> import icu
>>> print icu.ICU_VERSION
>>> print icu.VERSION

Comment (19.01.2014): There are other unofficial PyICU versions available some where in the web. But be careful to use other than the one above. Unexpected issues may be caused.



  • Enable creation of graphs using GraphViz engine.
  • Without this no beautiful graphs can be created.
  • Obtain it from:

19.01.2014: Following the information on we get the current package from

For the examples we copy the complete content to "C:\Program Files (x86)\Graphviz2.36\".

To give Gramps the access to this software we have to add the directory of the related binaries to the PATH environment variable. But to prevent trouble with the used dll versions between GraphViz and Gramps it's strongly recommended to add this at the end of PATH

SET PATH=%PATH%;C:\Program Files (x86)\Graphviz2.30\bin\
Using "Graph View" GraphViz 2.34 or higher forces an error (#7109 Fixed in Gramps 4.2.0). At #7109 you will find a patch to solve the issue for older versions of Gramps.
Without this patch and a still unsolved issue one should use from The handling is the same as above

Comments: GraphViz will be used e. g. for any report in Reports --> Graphs. Without GraphViz there is only one output format "Graphvi File". If all is OK there are several output formats available (e. g. "PDF (Graphviz)", "JPEG image" etc.).

  1. 7109


24.02.2013: Will not be used any more, replaced by GExiv2

ghostscript ghostview

Optional packages

  • From download the "Ghostscript GPL Release" for "Ghostscript 9.10 for Windows (32 bit)" and run the downloaded file gs910w32.exe. For the example we again use the default installation.
    • Python / Gramps needs to know the folder where the binaries are stored (default: "C:\Program Files (x86)\gs\gs9.10\bin") by defining the environment variable PATH. SET PATH=%PATH%;C:\Program Files (x86)\gs\gs9.10\bin\
    • As option it's possible to place the content of the binary folder (default: "C:\Program Files (x86)\gs\gs9.10\bin") into the same folder as python.exe to prevent any changes of the environment variable PATH.
  • From download and run gsv50w32.exe (e. g. into the default install folder: C:\Program Files (x86)\Ghostgum).
    • Python / Gramps needs to know the folder where the binaries are stored (default: "C:\Program Files (x86)\Ghostgum\gsview") by defining the environment variable PATH.
      Comment: This tool will be used to display .ps files as optional result of reports. So at least it's like e.g. any a .pdf viewer or .rtf viewer. It would be possible to include it into any Gramps package. But as normally nobody would include a .pdf viewer or .rtf viewer into a Gramps package I won't suggest to do that for a .ps viewer.
    • alternate


Requirements from README (optional package):

--> will not be used
There is still the same issue as in Gramps 3.0.1 and later 3124. 
Currently there is no special code like 'if win(): DON'T USE RCS'.
It seems to be working but the reload from an archived database doesn't run.
Finally it doesn't matter to install rcs.


Requirements from README (optional package):

  • Python Image Library is needed to convert non jpg images to jpg so as to include them in LaTeX output

From download PIL-1.1.7.win32-py2.7.exe. Run this installation to add PIL to the used Python version.


Information from README: More font support in the reports

07.03.2013 TODO WORK: How to use for the Windows environment. It's assumed that the fonts should be added to the Graphviz environment, but not yet tested.

Debug Environment


TODO WORK: description


TODO WORK: description

dependency viewer

TODO WORK: description

Start Gramps 4.0.x

Get Gramps sources

For all examples it's assumed that the Gramps source (e.g. from the GIT repository or the .tar.gz from from will be stored into "C:\Gramps4.0".

It's helpful to use a special client for Windows to get these sources. Also if one gets sources only such a tool provides the possibility of history search and or compare and also to mark differences between the current version on the computer and the repository.

There are good experiences using TortoiseGIT from

Prepare Setup

[Changed 03.12.2013] To run we need the translation tool msgfmt.exe having a proper version. The installer for poedit ( provides msgfmt.exe in version

Latest version of poedit available from

For all examples we assume poedit to be installed to: "C:\Program Files (x86)\Poedit" (The default path of the installer).

Run Setup Build

Running " build" generates necessary translation files (*.mo) and the from

Here is an example batch file to run this:

cd C:\Gramps4.0
set path=C:\Python27;C:\Program Files (x86)\Poedit\bin;C:\Program Files (x86)\Poedit\GettextTools\bin;%path%
C:\Python27\python build

The result should look like this:

running build
Compiling po\bg.po >> share/locale/bg/LC_MESSAGES.
Compiling po\ca.po >> share/locale/ca/LC_MESSAGES.
Compiling po\cs.po >> share/locale/cs/LC_MESSAGES.
Compiling po\da.po >> share/locale/da/LC_MESSAGES.
Compiling po\de.po >> share/locale/de/LC_MESSAGES.
Compiling po\el.po >> share/locale/el/LC_MESSAGES.
Compiling po\en_GB.po >> share/locale/en_GB/LC_MESSAGES.
Compiling po\es.po >> share/locale/es/LC_MESSAGES.
Compiling po\fi.po >> share/locale/fi/LC_MESSAGES.
Compiling po\fr.po >> share/locale/fr/LC_MESSAGES.
Compiling po\he.po >> share/locale/he/LC_MESSAGES.
Compiling po\hr.po >> share/locale/hr/LC_MESSAGES.
Compiling po\hu.po >> share/locale/hu/LC_MESSAGES.
Compiling po\it.po >> share/locale/it/LC_MESSAGES.
Compiling po\ja.po >> share/locale/ja/LC_MESSAGES.
Compiling po\lt.po >> share/locale/lt/LC_MESSAGES.
Compiling po\nb.po >> share/locale/nb/LC_MESSAGES.
Compiling po\nl.po >> share/locale/nl/LC_MESSAGES.
Compiling po\nn.po >> share/locale/nn/LC_MESSAGES.
Compiling po\pl.po >> share/locale/pl/LC_MESSAGES.
Compiling po\pt_BR.po >> share/locale/pt_BR/LC_MESSAGES.
Compiling po\pt_PT.po >> share/locale/pt_PT/LC_MESSAGES.
Compiling po\ru.po >> share/locale/ru/LC_MESSAGES.
Compiling po\sk.po >> share/locale/sk/LC_MESSAGES.
Compiling po\sl.po >> share/locale/sl/LC_MESSAGES.
Compiling po\sq.po >> share/locale/sq/LC_MESSAGES.
Compiling po\sv.po >> share/locale/sv/LC_MESSAGES.
Compiling po\uk.po >> share/locale/uk/LC_MESSAGES.
Compiling po\vi.po >> share/locale/vi/LC_MESSAGES.
Compiling po\zh_CN.po >> share/locale/zh_CN/LC_MESSAGES.
running build_py
copying gramps\gen\ -> build\lib\gramps\gen
copying gramps\gui\glade\ -> build\lib\gramps\gui\glade
running build_scripts
creating build\scripts-2.7
copying and adjusting scripts\gramps -> build\scripts-2.7
Hit any key . . .

Possible exception:

  • stops because of a missing "intltool-merge".
  • assumes for Windows to have either non installed "intltools" or complete installed "intltools". In some rare situations it could be possible to have an incomplete installation of these tools. But because we don't need these tools to run Gramps itself it's necessary to edit in such cases: Insert "return (0, 0, 0)" direct behind "if sys.platform == 'win32':" in "def intltool_version():".
 def intltool_version():
     Return the version of intltool as a tuple.
     if sys.platform == 'win32':
         return (0, 0, 0)
         cmd = ["perl", "-e print qx(intltool-update --version) =~ m/(\d+.\d+.\d+)/;"]


  • After running this it would be possible to run Gramps from "C:\Gramps4.0" or from some where "C:\Gramps4.0\build\...".
  • For easy handling of sources from the repository the author prefers to run it from "C:\Gramps4.0".
  • It's also possible to generate .mo files by command line jobs. (TODO WORK: description)
  • It's also possible to manipulate manually. (TODO WORK: description)

Work arounds

TODO ISSUE: Each work around to be removed if not necessary any more

19.01.2014: To get the license information within the Help-About dialogue one has to copy the file COPYING from the Gramps sources root (e.g. C:\Gramps4.0) into the to be generated folder <gramps root>\build\data (e.g.: C:\Gramps4.0\build\data).

Overall appearance

A short description 'How to control the general view of Gramps using GTK themes':

  • For our example theme packages have to be stored in "C:\Python27\Lib\site-packages\gnome\share\themes". Per default with the here used GTK package there are three packages available:
    • Adwaita
    • Bluebird
    • Default
    • Emacs
    • Evolve
    • Greybird
    • HighContrast
    • Orion

To select one of these themes one has to manipulate the a special settings.ini file. For our example it's placed there:

  • C:\Python27\Lib\site-packages\gnome\etc\gtk-3.0\settings.ini
  • This example for settings.ini defines the theme "Adwaita" and the font "Segoe UI" having the font size 10:
gtk-theme-name = HighContrast
gtk-font-name = Segoe UI 10

More information and links regarding GTK3 themes may be found in the web (e.g.

Start Gramps

At this point we have a basically running Gramps.

Because we didn't add all packages suggested by the README we didn't have the full functionality. Especially some output formats are not available yet (TODO WORK: Add the missing packages having a usable version.)

For Gramps 4.1 development there may still be issues etc (see bug tracker: It's strongly recommended to use test data for validation only!

To run Gramps a batch seems to be helpful:

set LANG=de_DE
@rem may be some time we need an other language
@rem set LANG=de_DE
@rem it's a good idea to have a own GRAMPSHOME
set GRAMPSHOME=C:\Gramps40
@rem we need the path of the Gtk binaries
set path=C:\Goocanvas;C:\Program Files (x86)\gs\gs9.10\bin;C:\icu;%path%;C:\Program Files (x86)\Graphviz2.36\bin
@rem let's jump to Python binaries
cd C:\Python27
@rem call for all version information (e.g. as background for any issue)
python "C:\Gramps4.0\" -v
@rem let's start Gramps
python "C:\Gramps4.0\"

"Gramps -v" should show this information now if one uses the gramps-4.0.2.tar.gz from

Gramps Settings:
 python    : 2.7.6
 gramps    : 4.0.2
 gtk++     : 3.10.6
 pygobject : 3.10.2
 pango     : 1.36.1
 Not using bsddb3
 bsddb     : 5.3.0
 bsddb.db  : 4.7.25
 cairo     : 1.12.16
 pycairo   : 1.10.0
 osmgpsmap : 1.0
 GExiv2    : 0.4
 ICU       : 50.1.2
 PyICU     : 1.5
 o.s.      : win32

Environment settings:
 LANG      : de_DE.UTF-8
 GRAMPSI18N: not set
 GRAMPSHOME: C:\Gramps40
 GRAMPSDIR : not set

Non-python dependencies:
 Graphviz  : 2.36
 Ghostscr. : 9.10

System PATH env variable:
    C:\Program Files (x86)\gs\gs9.10\bin

Known Major Issues

As known per 2013-12-16

  • GraphViz 2.34 and later causes an error in Graph View:see 7277 for more details(It's solved with the AIO for Gramps 4.1.1)
  • no Django
  • gtkspell:
    • Opening the note editor having spell activated or activating the spell within the note editor blocks Python / the application for a while (as longer as larger the text). Therefore it's suggested to deactivate the spell checker in Preferences. But it's the same if one toggles this feature or changes the spell language interactive using the right mouse context menu in the Note Editor.
    • The spell settings will not be stored.
  • The Geographic view and other gtk parts may generate warnings without any other known effect
  • WinXP (26.12.13): see information above

See also