Difference between revisions of "Run Gramps40 for Windows from source using Python 2.7.3"

From Gramps
Jump to: navigation, search
(pyexiv2)
m (Prepare Setup)
(46 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Introduction==
 
==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.
+
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 (since July 2013 also 2.7.5) because of several issues related to Gtk and database connection. All steps were done by the author on Windows 7 64bit German. (There are first user experiences that the following also run for WinXP 32bit and Win8 )
 +
 
 +
 
  
 
There are some parts marked as "TODO ISSUE" because of known issues.
 
There are some parts marked as "TODO ISSUE" because of known issues.
Line 7: Line 9:
  
 
{{man warn| This is a work in progress... <br/>Nobody guarantees anything at all!<br/>Any comments and help (e.g. on wiki pages) are welcome.}}
 
{{man warn| This is a work in progress... <br/>Nobody guarantees anything at all!<br/>Any comments and help (e.g. on wiki pages) are welcome.}}
 +
 +
Last update: 03.09.2013 (section "Prepare Setup" and "Run Setup Build" are adapted for using a newer version of msgfmt.exe)
  
 
==Python==
 
==Python==
 
Requirements from README:  
 
Requirements from README:  
 
* Python 2.7 or greater, Python 3.2 or greater (python version cannot be mixed)
 
* Python 2.7 or greater, Python 3.2 or greater (python version cannot be mixed)
We use: Python 2.7.3 32 bit from http://www.python.org/getit/ for all examples assumed to be installed into "C:\Python27".
+
We use: Python 2.7.3 32 bit from http://www.python.org/getit/ for all examples assumed to be installed into "C:\Python27".<br>
+
Comment: It's also possible to use Python 2.7.5 32 bit from http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi<br>
 
Comment: For Win7 user it's easier to don't use "C:\Program Files (x86)\..." because for every change somewhere in this folder one has to activate the administrator's rights again and again.
 
Comment: For Win7 user it's easier to don't use "C:\Program Files (x86)\..." because for every change somewhere in this folder one has to activate the administrator's rights again and again.
  
Line 23: Line 27:
 
* xdg-utils
 
* xdg-utils
 
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):
 
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):
* 24.02.2013: pygi-aio-3.4.2rev7.7z from http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2rev7.7z&can=2&q=  
+
* 06.04.2013: pygi-aio-3.4.2rev11.7z from http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2rev11.7z&can=2&q=pygi-aio-3.4.2rev11
** content of pygi-aio-3.4.2rev7.7z\py27\ to be copied into "C:\Python27\Lib\site-packages"  
+
** content of pygi-aio-3.4.2rev11.7z\py27\ to be copied into "C:\Python27\Lib\site-packages"  
** content of pygi-aio-3.4.2rev7.7z\gtk\ to be copied into "C:\Python27\Lib\site-packages\gtk"
+
** content of pygi-aio-3.4.2rev11.7z\gtk\ to be copied into "C:\Python27\Lib\site-packages\gtk"  
* 23.02.2013(Deprecated): <strike>pygi-aio-3.4.2rev6.7z from http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2rev6.7z&can=2&q=  
+
* 11.03.2013 (Deprecated): <strike>pygi-aio-3.4.2rev10.7z from http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2rev10.7z&can=2&q=pygi-aio-3.4.2rev10.7z  
** content of pygi-aio-3.4.2rev6.7z\py27\ to be copied into "C:\Python27\Lib\site-packages"
+
** content of pygi-aio-3.4.2rev10.7z\py27\ to be copied into "C:\Python27\Lib\site-packages"  
** content of pygi-aio-3.4.2rev6.7z\gtk\ to be copied into "C:\Python27\Lib\site-packages\gtk"  
+
** content of pygi-aio-3.4.2rev10.7z\gtk\ to be copied into "C:\Python27\Lib\site-packages\gtk"</strike>   
** To prevent issue [http://www.gramps-project.org/bugs/view.php?id=6429 6429] download Gtk-3.0.typelib from the issue page and overwrite the same file in "C:\Python27\Lib\site-packages\gtk\lib\girepository-1.0" (TODO WORK: to be removed if the new typelib is part of the package)</strike>
+
* Deprecated versions before 11.03.2013 see history
* 16.02.2013, 12.02.2013 (Deprecated): <strike>pygi-aio-3.4.2rev5.7z from http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2rev5.7z&can=2&q= as Python site-package
+
** To prevent issue [http://www.gramps-project.org/bugs/view.php?id=6429 6429] download Gtk-3.0.typelib from the issue page and overwrite the same file in "C:\Python27\Lib\site-packages\gtk\lib\girepository-1.0" (TODO WORK: to be removed if the new typelib is part of the package)</strike>
+
* 09.02.2013 (Deprecated): <strike>pygi-aio-3.4.2.7z from http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2.7z&can=2 as Python site-package and these patches:
+
** patch from http://osspack32.googlecode.com/files/gdk-pixbuf.7z GdkPixbuf-2.0.typelib to be copied into "C:\Python27\Lib\site-packages\gtk\lib\girepository-1.0"
+
** patch from http://osspack32.googlecode.com/files/libtiff-5.dll to be copied into "C:\Python27\Lib\site-packages\gtk"
+
** patch from http://osspack32.googlecode.com/files/libgdk_pixbuf-2.0-0.dll.7z to be copied into "C:\Python27\Lib\site-packages\gtk"</strike>
+
  
 
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!
 
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!
Line 44: Line 42:
 
  Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32
 
  Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32
 
  Type "help", "copyright", "credits" or "license" for more information.
 
  Type "help", "copyright", "credits" or "license" for more information.
  >>> from gi.repository import GObject
+
  >>> from gi.repository import Gtk
 
  >>> Gtk.get_major_version()
 
  >>> Gtk.get_major_version()
 
  3L
 
  3L
Line 54: Line 52:
 
  >>> GObject.pygobject_version
 
  >>> GObject.pygobject_version
 
  (3, 4, 2)
 
  (3, 4, 2)
 +
 +
===ICU/PyICU===
 +
This new used package is a "must be".
 +
 +
27.02.2013: Download http://dl.dropbox.com/u/81888101/Gramps/PYICU_py27_win32.zip.
 +
* 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):
 +
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32
 +
Type "help", "copyright", "credits" or "license" for more information.
 +
>>> import icu
 +
>>> print icu.ICU_VERSION
 +
50.1.2
 +
>>> print icu.VERSION
 +
1.5
  
 
===language-pack-gnome-xx===
 
===language-pack-gnome-xx===
Line 59: Line 73:
 
* 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.
 
* 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:  
+
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:
* 23.02.2013: From http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2rev6-opt.7z&can=1&q=pygi-aio download pygi-aio-3.4.2rev6-opt.7z
+
* 11.03.2013: from http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2rev10-opt.7z&can=2&q=pygi-aio-3.4.2rev10.7z download pygi-aio-3.4.2rev10-opt.7z  
* 16.02.2013 (Deprecated): <strike>From http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2rev4-opt.7z&can=2&q= download "pygi-aio-3.4.2rev4-opt.7z".</strike>
+
* 07.03.2013 (Deprecated): <strike>From http://code.google.com/p/osspack32/downloads/detail?name=pygi-aio-3.4.2rev8-opt.7z&can=2&q= download pygi-aio-3.4.2rev8-opt.7z</strike>
 +
* Deprecated versions before 07.03.2013 see history
  
 
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".
 
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".
Line 68: Line 83:
 
Requirements from README (*STRONGLY RECOMMENDED*):
 
Requirements from README (*STRONGLY RECOMMENDED*):
 
* Used to show maps in the geography view. Without this the GeoView will not be active, see http://gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_Main_Window#Geography_Category
 
* Used to show maps in the geography view. Without this the GeoView will not be active, see http://gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_Main_Window#Geography_Category
* The package is named osmgpsmap, osm-gps-map or python-osmgpsmap. Or obtain it from: http://nzjrs.github.com/osm-gps-map/  
+
* The package is named osmgpsmap, osm-gps-map or python-osmgpsmap. Or obtain it from: http://nzjrs.github.com/osm-gps-map/ (Comment: There is no direct download from this web page)
  
TODO WORK: Add this package. But where to get? The link above doesn't help currently to get a complete package for this environment.
+
==> osmgpsmap is an optional package even the README requires "strongly recommended".
  
Comment: There is currently no message during the start-up of Gramps about a missing osmgpsmap. The only thing is the missing Geographic view in Gramps.
+
Add this package:
 +
* 11.03.2013: osmgpsmap is integrated part of the GTK3 package.
 +
* 07.03.2013 (Deprecated): <strike>From http://code.google.com/p/osspack32/downloads/detail?name=osm-gps-map-git.7z&can=2&q= download osm-gps-map-git.7z. For our example copy the content to "C:\Python27\Lib\site-packages".</strike>
 +
 
 +
Comments:
 +
* 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.
  
 
===GraphViz===
 
===GraphViz===
Line 90: Line 111:
  
 
===pyexiv2===
 
===pyexiv2===
'''24.02.2013: Will not be used any more, replaced by GExiv2'''<br>
+
'''24.02.2013: Will not be used any more, replaced by GExiv2'''
24.02.2013 (Deprecated): <strike>Requirements from README (*STRONGLY RECOMMENDED*):
+
* Enables Gramps to manage Exif metadata embedded in your media.
+
* Gramps needs version 0.1.3 or greater.
+
* Obtain it from: http://tilloy.net/dev/pyexiv2/download.html
+
  
From the web page as defined above we get for Python 2.7 pyexiv2-0.3.2-setup.exe and run it. During the running setup we choose a system wide installation into C:\Python27\Lib\site-packages. That's all in this case.
+
===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")
 +
* From http://pages.cs.wisc.edu/~ghost/gsview/get50.htm download gsv50w32.exe
  
The package will be used by the 'Image Metadata' Gramplet.
+
===GExiv2===
 +
Is an optional package.
 +
07.03.2013: GExiv2 is integrated part of the GTK3 package.  
  
The package will be replaced in the near future by gexiv2.</strike>
+
Because the EditExifMetadata add-on isn't currently available this package is tested for reading exif data only using the "image metadata" gramplet.
  
 
===gtkspell===
 
===gtkspell===
Line 142: Line 164:
 
From http://www.pythonware.com/products/pil/ download PIL-1.1.7.win32-py2.7.exe. Run this installation to add PIL to the used Python version.
 
From http://www.pythonware.com/products/pil/ download PIL-1.1.7.win32-py2.7.exe. Run this installation to add PIL to the used Python version.
  
===further Python packages===
+
===ttf-freefont===
TODO WORK: Add the missing packages having a usable version.
+
Information from README: More font support in the reports
Because of time all packages not list above are not tried up today. It will be the job of the next time to go ahead to add all these packages.
+
+
Requirements from README:
+
  
The following packages are optional  
+
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.  
  
  ttf-freefont    More font support in the reports
+
===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
  
  gir-webkit      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
 
  
  goocanvas2:
+
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<br>
                    Required for the Graphview plugin
+
TODO ISSUE: To have it run without any issue.
 +
 
 +
===goocanvas2===
 +
Information from README:
 +
* Required for the Graphview plugin
 +
 
 +
To add it:<br>
 +
* 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.<br>
 +
TODO ISSUE 07.03.2013: The Graphview is currently not stable!
  
 
==Debug Environment==
 
==Debug Environment==
Line 170: Line 196:
  
 
===Eclipse===
 
===Eclipse===
 +
TODO WORK: description
 +
 +
===dependency viewer===
 
TODO WORK: description
 
TODO WORK: description
  
Line 181: Line 210:
  
 
===Prepare Setup===
 
===Prepare Setup===
To run setup.py we need the translation tools from http://sourceforge.net/projects/gnuwin32/files/gettext/0.14.4/gettext-0.14.4.exe/download?use_mirror=switch&download=: Download gettext-0.14.4.exe and run it to install.
+
[Changed 03.09.2013]
 +
<strike>To run setup.py we need the translation tools from http://sourceforge.net/projects/gnuwin32/files/gettext/0.14.4/gettext-0.14.4.exe/download?use_mirror=switch&download=: Download gettext-0.14.4.exe and run it to install.
 +
 
 +
For all examples assumed to be installed to: "C:\Program Files (x86)\GnuWin32\bin" (The default path of the installer)</strike>
 +
 
 +
To run setup.py we need the translation tool msgfmt.exe having a proper version. The installer for poedit (http://sourceforge.net/projects/poedit/files/poedit/1.5/poedit-1.5.7-setup.exe/download) provides msgfmt.exe in version 0.18.1.0.  
  
For all examples assumed to be installed to: "C:\Program Files (x86)\GnuWin32\bin" (The default path of the installer)
+
For all examples we assume poedit to be installed to: "C:\Program Files (x86)\Poedit" (The default path of the installer).
  
 
===Run Setup Build===
 
===Run Setup Build===
Line 193: Line 227:
 
  C:
 
  C:
 
  cd C:\Gramps4.0
 
  cd C:\Gramps4.0
  set path=C:\Python27;C:\Program Files (x86)\GnuWin32\bin;%path%
+
  set path=C:\Python27;C:\Program Files (x86)\Poedit\bin;%path%
 
  C:\Python27\python setup.py build
 
  C:\Python27\python setup.py build
 
  pause
 
  pause
Line 230: Line 264:
 
  Compiling po\zh_CN.po >> share/locale/zh_CN/LC_MESSAGES.
 
  Compiling po\zh_CN.po >> share/locale/zh_CN/LC_MESSAGES.
 
  running build_py
 
  running build_py
 +
....
 
  copying gramps\gen\const.py -> build\lib\gramps\gen
 
  copying gramps\gen\const.py -> build\lib\gramps\gen
 +
copying gramps\gui\glade\updateaddons.glade -> build\lib\gramps\gui\glade
 
  running build_scripts
 
  running build_scripts
 +
creating build\scripts-2.7
 +
copying and adjusting scripts\gramps -> build\scripts-2.7
 
  C:\Gramps4.0>pause
 
  C:\Gramps4.0>pause
 
  Hit any key . . .
 
  Hit any key . . .
  
 +
 +
Possible exception:<br>
 +
setup.py stops because of a missing "intltool-merge". <br>
 +
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():".
 +
 +
      ...
 +
  def intltool_version():
 +
      <nowiki>'''</nowiki>
 +
      Return the version of intltool as a tuple.
 +
      <nowiki>'''</nowiki>
 +
      if sys.platform == 'win32':
 +
          '''return (0, 0, 0)'''
 +
          cmd = ["perl", "-e print qx(intltool-update --version) =~ m/(\d+.\d+.\d+)/;"]
 +
      ...
 
Comments:  
 
Comments:  
 
* After running this it would be possible to run Gramps from "C:\Gramps4.0" or from some where "C:\Gramps4.0\build\...".
 
* After running this it would be possible to run Gramps from "C:\Gramps4.0" or from some where "C:\Gramps4.0\build\...".
Line 244: Line 296:
 
TODO ISSUE: Each work around to be removed if not necessary any more
 
TODO ISSUE: Each work around to be removed if not necessary any more
  
* Currently there is an issue between setup.py and trans.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 '\\'
+
* 03.03.2013 (Deprecated): <strike>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 [http://www.gramps-project.org/bugs/view.php?id=6481 6481])</strike>
* 23.02.2013, 16.02.2013 (Deprecated): <strike>see also above how to install the Gtk package. As described in issue 6429 [http://www.gramps-project.org/bugs/view.php?id=6429] 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)</strike>
+
* 03.03.2013 (Deprecated): <strike>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 '\\'</strike>
 +
* 23.02.2013 (Deprecated): <strike>16.02.2013: see also above how to install the Gtk package. As described in issue 6429 [http://www.gramps-project.org/bugs/view.php?id=6429] 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)</strike>
  
 
===Overall appearance===
 
===Overall appearance===
Line 274: Line 327:
 
  <code>
 
  <code>
 
  set LANG=en_GB
 
  set LANG=en_GB
SET LANGUAGE=en_GB
 
 
   
 
   
 
  @rem may be some time we need an other language
 
  @rem may be some time we need an other language
  @rem set LANG=de
+
  @rem set LANG=de_DE
@rem SET LANGUAGE=de
+
 
   
 
   
 
  @rem it's a good idea to have a own GRAMPSHOME
 
  @rem it's a good idea to have a own GRAMPSHOME
  set GRAMPSHOME=C:\Gramps_test\Gramps40
+
  set GRAMPSHOME=C:\Gramps40
 
  @rem we need the path of the Gtk binaries
 
  @rem we need the path of the Gtk binaries
  set path=C:\Python27\lib\site-packages\gtk;%path%;C:\Program Files (x86)\Graphviz2.30\bin
+
  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
 
  @rem let's jump to Python binaries
Line 297: Line 348:
 
  </code>
 
  </code>
  
"Gramps -v" should show this information now:
+
"Gramps -v" should show this information now (last change 03.03.2013):
 
  Gramps Settings:
 
  Gramps Settings:
 
  ----------------
 
  ----------------
 
   python    : 2.7.3
 
   python    : 2.7.3
   gramps    : 4.0.0-alpha4-r21362M
+
   gramps    : 4.0.0-alpha5-r21574M
 
   gtk++    : 3.6.4
 
   gtk++    : 3.6.4
 
   pygobject : 3.4.2
 
   pygobject : 3.4.2
Line 310: Line 361:
 
   cairo    : 1.12.10
 
   cairo    : 1.12.10
 
   pycairo  : 1.10.0
 
   pycairo  : 1.10.0
   osmgpsmap : not found
+
   osmgpsmap : 0.8
   pyexiv2  : 0.3.2
+
   GExiv2    : 0.4
 +
  ICU      : 50.1.2
 +
  PyICU    : 1.5
 
   o.s.      : win32
 
   o.s.      : win32
 
   
 
   
 
  Environment settings:
 
  Environment settings:
 
  ---------------------
 
  ---------------------
   LANG      : en_GB
+
   LANG      : de_DE.UTF-8
   LANGUAGE  : en_GB
+
   LANGUAGE  : de_DE
 
   GRAMPSI18N: not set
 
   GRAMPSI18N: not set
   GRAMPSHOME: C:\Gramps_test\Gramps40
+
   GRAMPSHOME: C:\Gramps40
 
   GRAMPSDIR : not set
 
   GRAMPSDIR : not set
 
   PYTHONPATH:
 
   PYTHONPATH:
Line 329: Line 382:
 
     C:\Python27
 
     C:\Python27
 
     C:\Python27\lib\site-packages
 
     C:\Python27\lib\site-packages
 +
    C:\Python27\lib\site-packages\PIL
 
   
 
   
 
  Non-python dependencies:
 
  Non-python dependencies:
 
  ------------------------
 
  ------------------------
 
   Graphviz  : 2.30
 
   Graphviz  : 2.30
   Ghostscr. : Ghostscript not in system PATH
+
   Ghostscr. : 9.07
 
   
 
   
 
  System PATH env variable:
 
  System PATH env variable:
 
  -------------------------
 
  -------------------------
      C:\Python27\lib\site-packages\gtk
+
    C:\Goocanvas
      ...
+
    C:\Program Files (x86)\gs\gs9.07\bin
 +
    C:\icu
 +
    C:\Python27\lib\site-packages\gtk
 +
...
 +
 
 +
==Known Major Issues==
 +
As known per 01.04. to 18.07.2013
 +
* (23.07.2013 updated: it works well on WinXP 32 bit) <strike>The described system doesn't work for WinXP 32bit</strike>
 +
* Webview crashes for any web address "http://..." - but runs well for local file access
 +
* 06.04.2013 (resolved with pygi-aio-3.4.2rev11.7z): <strike>Graphical and text reports using PDF output crashes with a pango error ("Pango-CRITICAL **: pango_font_description_better_match: assertion `new_match != NULL' failed @ gramplet/welcomegramplet.py")</strike>
 +
* no Django
 +
* Spell:
 +
** 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).
 +
** The spell settings will not be stored.
 +
* GraphView (third party addon), 13.07.2013: crashes see http://www.gramps-project.org/bugs/view.php?id=6904
 +
* If LANG not equal en_GB Graphic reports in some cases produce empty PDF sheets or force graphviz to crash (see: http://www.gramps-project.org/bugs/view.php?id=6928)
  
 
==See also==
 
==See also==

Revision as of 13:38, 3 September 2013

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 (since July 2013 also 2.7.5) because of several issues related to Gtk and database connection. All steps were done by the author on Windows 7 64bit German. (There are first user experiences that the following also run for WinXP 32bit and Win8 )


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

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

Last update: 03.09.2013 (section "Prepare Setup" and "Run Setup Build" are adapted for using a newer version of msgfmt.exe)

Python

Requirements from README:

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

We use: Python 2.7.3 32 bit from http://www.python.org/getit/ for all examples assumed to be installed into "C:\Python27".
Comment: It's also possible to use Python 2.7.5 32 bit from http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi
Comment: For Win7 user it's easier to don't use "C:\Program Files (x86)\..." because for every change somewhere in this folder one has to activate the administrator's rights again and again.

Gtk, pyobject

Requirements from README:

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

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

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.
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gtk
>>> Gtk.get_major_version()
3L
>>> Gtk.get_minor_version()
6L
>>> Gtk.get_micro_version()
4L
>>> from gi.repository import GObject
>>> GObject.pygobject_version
(3, 4, 2)

ICU/PyICU

This new used package is a "must be".

27.02.2013: Download http://dl.dropbox.com/u/81888101/Gramps/PYICU_py27_win32.zip.

  • 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):

Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32
Type "help", "copyright", "credits" or "license" for more information.
>>> import icu
>>> print icu.ICU_VERSION
50.1.2
>>> print icu.VERSION
1.5 

language-pack-gnome-xx

Requirements from README (*STRONGLY RECOMMENDED*):

  • 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".

osmgpsmap

Requirements from README (*STRONGLY RECOMMENDED*):

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

Add this package:

Comments:

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

GraphViz

Requirements from README (*STRONGLY RECOMMENDED*):

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

Following the information on http://www.graphviz.org we get the current installation graphviz-2.30.msi from http://www.graphviz.org/Download_windows.php and run it.

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

GExiv2

Is an optional package. 07.03.2013: GExiv2 is integrated part of the GTK3 package.

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

gtkspell

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.

The basics to use a spell are already included in the here used GTK3 package. The only missed things are myspell dictionaries. These can be found:

  • from http://wiki.openoffice.org/wiki/Dictionaries download the language packages of your choice. In some cases (e.g. for German) it's more difficult because one has to download a "OpenOffice.org 3.x Extensions" package. For German one will get via http://extensions.services.openoffice.org/project/dict-de_DE_frami the file dict-de_DE-frami_2012-06-17.oxt. Using a program like 7-Zip one will find the necessary files (de_DE_frami.aff and de_DE_frami.dic) in "dict-de_DE-frami_2012-06-17.oxt\de_DE_frami\".
  • from e.g. the GrampsAOI3.4.2 package in "..\GrampsAIO32_3.4.2\share\enchant\myspell"

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

TODO ISSUE/WORK There are still some issues using spell:

  • Open the note editor having spell activated slows down the os extremely as longer as larger the text.
  • The spell settings will not be stored.

rcs

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

From http://www.pythonware.com/products/pil/ download PIL-1.1.7.win32-py2.7.exe. Run this installation to add PIL to the used Python version.

ttf-freefont

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.

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

For all examples it's assumed that the Gramps source (e.g. from the repository http://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps40) will be stored into "C:\Gramps4.0".

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.

There are good experiences using TortoiseSVN from http://tortoisesvn.net/downloads.html.

Prepare Setup

[Changed 03.09.2013] To run setup.py we need the translation tools from http://sourceforge.net/projects/gnuwin32/files/gettext/0.14.4/gettext-0.14.4.exe/download?use_mirror=switch&download=: Download gettext-0.14.4.exe and run it to install.

For all examples assumed to be installed to: "C:\Program Files (x86)\GnuWin32\bin" (The default path of the installer)

To run setup.py we need the translation tool msgfmt.exe having a proper version. The installer for poedit (http://sourceforge.net/projects/poedit/files/poedit/1.5/poedit-1.5.7-setup.exe/download) provides msgfmt.exe in version 0.18.1.0.

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 "setup.py build" generates necessary translation files (*.mo) and the const.py from const.py.in

Here is an example batch file to run this:


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

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\const.py -> build\lib\gramps\gen
copying gramps\gui\glade\updateaddons.glade -> build\lib\gramps\gui\glade
running build_scripts
creating build\scripts-2.7
copying and adjusting scripts\gramps -> build\scripts-2.7
C:\Gramps4.0>pause
Hit any key . . .


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():".

     ...
 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+)/;"]
     ...

Comments:

  • 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 const.py manually. (TODO WORK: description)

Work arounds

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

  • 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:
[Settings]
gtk-theme-name = Adwaita
gtk-font-name = Segoe UI 10

More information and links regarding GTK3 themes may be found in the web (e.g. https://wiki.archlinux.org/index.php/GNOME#Overall_appearance)

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

Because Gramps 4.0 is still under development there are still several issues and crashes (see bug tracker: http://www.gramps-project.org/bugs/view_all_bug_page.php). It's strongly recommended to use test data for validation only!

To run Gramps a batch seems to be helpful:


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

Gramps Settings:
----------------
 python    : 2.7.3
 gramps    : 4.0.0-alpha5-r21574M
 gtk++     : 3.6.4
 pygobject : 3.4.2
 pango     : 1.32.6
 Not using bsddb3
 bsddb     : 4.8.4.2
 bsddb.db  : 4.7.25
 cairo     : 1.12.10
 pycairo   : 1.10.0
 osmgpsmap : 0.8
 GExiv2    : 0.4
 ICU       : 50.1.2
 PyICU     : 1.5
 o.s.      : win32

Environment settings:
---------------------
 LANG      : de_DE.UTF-8
 LANGUAGE  : de_DE
 GRAMPSI18N: not set
 GRAMPSHOME: C:\Gramps40
 GRAMPSDIR : not set
 PYTHONPATH:
    C:\Python27\python27.zip
    C:\Python27\DLLs
    C:\Python27\lib
    C:\Python27\lib\plat-win
    C:\Python27\lib\lib-tk
    C:\Python27
    C:\Python27\lib\site-packages
    C:\Python27\lib\site-packages\PIL

Non-python dependencies:
------------------------
 Graphviz  : 2.30
 Ghostscr. : 9.07

System PATH env variable:
-------------------------
    C:\Goocanvas
    C:\Program Files (x86)\gs\gs9.07\bin
    C:\icu
    C:\Python27\lib\site-packages\gtk
...

Known Major Issues

As known per 01.04. to 18.07.2013

  • (23.07.2013 updated: it works well on WinXP 32 bit) The described system doesn't work for WinXP 32bit
  • Webview crashes for any web address "http://..." - but runs well for local file access
  • 06.04.2013 (resolved with pygi-aio-3.4.2rev11.7z): Graphical and text reports using PDF output crashes with a pango error ("Pango-CRITICAL **: pango_font_description_better_match: assertion `new_match != NULL' failed @ gramplet/welcomegramplet.py")
  • no Django
  • Spell:
    • 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).
    • The spell settings will not be stored.
  • GraphView (third party addon), 13.07.2013: crashes see http://www.gramps-project.org/bugs/view.php?id=6904
  • If LANG not equal en_GB Graphic reports in some cases produce empty PDF sheets or force graphviz to crash (see: http://www.gramps-project.org/bugs/view.php?id=6928)

See also