Introduction

This page gives information how to run Gramps 4.0.x from source on a Windows system. After some trials there was the result to focus on 32 bit Python 2.7.3 because of several issues related to Gtk and database connection. All steps were done by the author on Windows 7 64bit German.

There are some parts marked as "TODO ISSUE" because of known issues.

There are some parts marked as "TODO WORK" because it's not done yet done (work in progress).

This is a work in progress... Nobody guarantees anything at all!Any comments and help (e.g. on wiki pages) are welcome.

Last update: 10.07.2013 (possible exception using setup.py)

Python

Requirements from README:

Python 2.7 or greater, Python 3.2 or greater (python version cannot be mixed)

Gtk, pyobject

Currently there are no official binaries available. With the help of an open source programmer we got 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: http://opensourcepack.blogspot.de/2013/01/mypaint-and-pygi.html):

content of pygi-aio-3.4.2rev10.7z\py27\ to be copied into "C:\Python27\Lib\site-packages"

content of pygi-aio-3.4.2rev10.7z\gtk\ to be copied into "C:\Python27\Lib\site-packages\gtk"

Deprecated versions before 11.03.2013 see history

Comment: For all examples it's assumed that the included Gtk binaries will be stored into "C:\Python27\Lib\site-packages\gtk" and it's also strongly assumed that this value will be added to the windows environment variable PATH!

Checking the state of the package can be done by:

start Python (e. g.: C:\Python27>python)

and than call the functions as follows. There should be the same results.

ICU/PyICU

Copy all files from PYICU_py27_win32.zip\lib\site-packages to "C:\Python27\Lib\site-packages"

Copy all files from PYICU_py27_win32.zip\bin to folder found by Python / Gramps. In any final version all binaries can be stored in the folder. But for our trials we prefer a separate folder to be independent from other packages: "C:\icu". Because of this decision we have to add the this to the environment variable PATH.

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

language-pack-gnome-xx

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). It's to find in an other distribution package because of the limits of the used repository:

Copy the folder "pygi-aio-3.4.2rev?-opt.7z\gtk\share\locale" into the related Gtk folder "..\site-packages\gtk\share\locale". For our example this would be: "C:\Python27\Lib\site-packages\gtk\share\locale".

For the examples we used the default installation path "C:\Program Files (x86)\Graphviz2.30\" and the installation for 'everyone'.

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

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.).

pyexiv2

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

ghostscript ghostview

Optional packages

From http://www.ghostscript.com/download/gsdnld.html download the "Ghostscript GPL Release" and run the downloaded file gs907w32.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.07\bin")

--> 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.
Additional comment:
It seems to be better in general to use the Gramps function "Make Backup..."
than to archive a bsddb database what means in detail also more an backup
than an archive. It could be a good idea to handle such backups in the db
open window like archives using rcs. (TODO WORK: add an feature request)

PIL

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

ttf-freefont

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.

gir-webkit

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/htmlrenderer.py and src/plugins/view/geoview.gpr.py, so as to remove: from gi.repository import WebKit as webkit

07.03.2013: Webkit is an integrated part of the GTK3 package. But currently it runs for internal file addresses only. Any web address "http://..." crashes
TODO ISSUE: To have it run without any issue.

goocanvas2

Information from README:

Required for the Graphview plugin

To add it:

07.03.2013: From http://ftp.gnome.org/pub/GNOME/binaries/win32/goocanvas/2.0/ download goocanvas-2.0.1-win32.zip and store the goocanvas-2.0.1-win32.zip\bin\libgoocanvas-2.0-9.dll into a folder found by Gramps. For our example we use a own folder to be interdependent from any other changes: C:\Goocanvas.

From the GrampsAIO32_3.4.2\lib\site-packages copy goocanvas.pyd into C:\Python27\Lib\site-packages (TODO WORK: Have a better place to download from.)

To use this one needs the Graphview add-on.
TODO ISSUE 07.03.2013: The Graphview is currently not stable!

Debug Environment

MinGW

TODO WORK: description

Eclipse

TODO WORK: description

dependency viewer

TODO WORK: description

Start Gramps 4.0

Get Gramps sources

It's helpful to use a Subversion 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.

Possible exception:
setup.py stops because of a missing "intltool-merge".
setup.py 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 setup.py in such cases: Insert "return (0, 0, 0)" direct behind "if sys.platform == 'win32':" in "def intltool_version():".

Work arounds

03.03.2013 (Deprecated): 27.02.2013: Using LANG to force Gramps to use an other language than English runs at least for LANG=de_DE into an error (see 6481)

03.03.2013 (Deprecated): Currently there is an issue between setup.py and the code using the content of const.py that's why we need manually changes in ""C:\Gramps4.0\gramps\gen\const.py, line 203 to 206: In all string paths for LOCALE_DIR , DATA_DIR, IMAGE_DIR, DOC_DIR replace '\' by '\\'

23.02.2013 (Deprecated): 16.02.2013: see also above how to install the Gtk package. As described in issue 6429 [1] there is a work around to have the drop down menu for gramplets in the side and bottom bar working: new "Gdk-3.0.typelib" from this issue page (TODO ISSUE: to be removed if the new typelib is part of the package)

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\gtk\share\themes". Per default with the here used GTK package there are three packages available:

Adwaita

Default

Emacs

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\gtk\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:

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 and the geographic view are not available yet (TODO WORK: Add the missing packages having a usable version.)

set LANG=en_GB
@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.07\bin;C:\icu;C:\Python27\lib\site-packages\gtk;%path%;C:\Program Files (x86)\Graphviz2.30\bin
@rem let's jump to Python binaries
C:
cd C:\Python27
@rem call for all version information (e.g. as background for any issue)
python "C:\Gramps4.0\gramps.py" -v
@rem let's start Gramps
python "C:\Gramps4.0\gramps.py"
pause

"Gramps -v" should show this information now (last change 03.03.2013):