Gramps 5.1, MacOS Ventura.
Apparently, Gramps uses the GTK graphical APIs. However, I am having difficulty loading any form of GTK on my Mac. Does anyone know how to solve this problem?
There’s a wikipage that speaks of oddities setting up GTK on the OS X precursor.
Does any of that help?
(There are several more “build for source” Mac OS X pages in the Developer Packaging category index.)
Look out for this:
Cheers
I think that page may be out of date. I tried using the gtk-osx-build-setup.sh received from the redirection on that web page but when it ran I got:
bill@iMac ~ % ./gtk-osx-build-setup.sh
Could not find jhbuild revision to use.
If I build jhbuild from the git instructions, the distutils package isn’t there.
What jhbuild version is gtk-osx-build-setup.sh looking for, and how do I fix this?
The title of this thread may not have drawn the attention of the Mac experts. I don’t think many of those developer monitor this forum.
@trlvn @ctreleaven @kulath who are the people that should be mentioned?
Sorry, I can’t help with a development environment. I used to contribute a bit to the MacPorts project (ie packaging) but I’ve pretty much wound that down. Gramps is pretty easy to install via MacPorts but that doesn’t get you a local copy of the Gramps git repository.
Craig
This is what I have and it is currently working:
ProductName: macOS
ProductVersion: 13.7.4
BuildVersion: 22H420
(. venv313/bin/activate; which python3)
/Users/lsanchez-chopitea/projects/genealogy/gramps6/venv313/bin/python3
(. venv313/bin/activate; perl -MCwd -le 'print Cwd::abs_path(shift)' "venv313/bin/python3")
/opt/local/Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
(. venv313/bin/activate; python3 --version)
Python 3.13.2
(. venv313/bin/activate; pip freeze --local)
babelfish==0.6.1
certifi==2025.1.31
charset-normalizer==3.4.1
diskcache==5.6.3
fake-useragent==2.0.3
genealogy-familysearch==0.1.3
genealogy-generic==0.1.7
genealogy-gramps==0.1.6
genealogy-toponym==0.1.2
getmyancestors==1.1.1
gramps==6.0.0rc1
idna==3.10
importlib_metadata==8.6.1
Levenshtein==0.27.1
orjson==3.10.15
postal==1.1.9
pycairo==1.27.0
PyGObject==3.52.1
RapidFuzz==3.12.2
requests==2.32.3
six==1.17.0
urllib3==2.3.0
zipp==3.21.0
The key for me was to use the macports python and not the homebrew.
Cheers
Can we take two steps back and address a simple question - what is it you are trying to do.
- If you just want to run gramps, install from the dmg file. Nothing else needed.
- If you want to write an addon, you do not need a development environment other than what is installed by default on Mac.
- If you want to build from source, you need to install a dev environment. Best description for this is Mac OS X:Build from source:Application package - Gramps
- If you want to create your own module repo for your custom addons, you will need a dev environment.
Assuming you want to write an addon, you can create it in the default directory for addons and do edit/test cycles pretty fast. You can review the SampleReport addon Sample Report for new developers as an example.
Thank you for showing your development environment. One item you have that I can’t seem to get is PyGObject. No matter how I try to load it (pip, pip3, brew) it never shows up and I get errors stating module gi not found. How did you manage to get that package?
My primary goal is to be able to insert mutiple pages containing image files (jpg, or png) in a generated book. Ancestry greates some nice information and maps for an individual’s DNA. I would like to insert those in a generated book. I assumed (always a bad idea) that could be done in a report.
Create your book with the various reports, indexes, table of contents, etc. When it comes time to print, choose “Open Document Text”. This will create the report in a Word/LibreOffice Write document. You can then edit this file adding all your extras where needed. You can add the codes to add these items to the index or TOC. You can even edit the newly created Index page by adding columns and other edits to “make it pretty”. When done, now you can actually print to paper or a PDF file.
Little env setup:
#! /usr/bin/env bash
set -x
set -e
/opt/local/bin/python3.13 -m venv venv
. venv/bin/activate
pip install --upgrade pip
CFLAGS='-I/opt/local/include -L/opt/local/lib' pip install PyGObject
pip freeze --local
Output:
+ set -e
+ /opt/local/bin/python3.13 -m venv venv
+ . venv/bin/activate
++ deactivate nondestructive
++ '[' -n '' ']'
++ '[' -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ unset VIRTUAL_ENV_PROMPT
++ '[' '!' nondestructive = nondestructive ']'
++ case "$(uname)" in
+++ uname
++ export VIRTUAL_ENV=/Users/lsanchez-chopitea/projects/test/macdev/venv
++ VIRTUAL_ENV=/Users/lsanchez-chopitea/projects/test/macdev/venv
++ _OLD_VIRTUAL_PATH='/usr/local/opt/openssl/bin:/Users/lsanchez-chopitea/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/iTerm.app/Contents/Resources/utilities'
++ PATH='/Users/lsanchez-chopitea/projects/test/macdev/venv/bin:/usr/local/opt/openssl/bin:/Users/lsanchez-chopitea/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/iTerm.app/Contents/Resources/utilities'
++ export PATH
++ VIRTUAL_ENV_PROMPT=venv
++ export VIRTUAL_ENV_PROMPT
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ PS1='(venv) '
++ export PS1
++ hash -r
+ pip install --upgrade pip
Requirement already satisfied: pip in ./venv/lib/python3.13/site-packages (24.3.1)
Collecting pip
Using cached pip-25.0.1-py3-none-any.whl.metadata (3.7 kB)
Using cached pip-25.0.1-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 24.3.1
Uninstalling pip-24.3.1:
Successfully uninstalled pip-24.3.1
Successfully installed pip-25.0.1
+ CFLAGS='-I/opt/local/include -L/opt/local/lib'
+ pip install PyGObject
Collecting PyGObject
Using cached pygobject-3.52.3.tar.gz (1.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting pycairo>=1.16 (from PyGObject)
Using cached pycairo-1.27.0-cp313-cp313-macosx_13_0_x86_64.whl
Building wheels for collected packages: PyGObject
Building wheel for PyGObject (pyproject.toml) ... done
Created wheel for PyGObject: filename=pygobject-3.52.3-cp313-cp313-macosx_13_0_x86_64.whl size=247952 sha256=e2a174f5b47130a12de8fe41ff14977fae5ddf56eaf792a6f97d2449a72fa025
Stored in directory: /Users/lsanchez-chopitea/Library/Caches/pip/wheels/01/47/8e/384d5bb61caeb02846d462b3eba30458370ae1c07cdea57217
Successfully built PyGObject
Installing collected packages: pycairo, PyGObject
Successfully installed PyGObject-3.52.3 pycairo-1.27.0
+ pip freeze --local
pycairo==1.27.0
PyGObject==3.52.3
I have also had to do:
brew reinstall pkgconf
brew reinstall libffi
HTH.
Thanks for the help. It doesn’t seem to work on my system. I get
+ pip install PyGObject
Collecting PyGObject
-
Using cached pygobject-3.52.3.tar.gz (1.2 MB)*
-
Installing build dependencies … done*
-
Getting requirements to build wheel … error*
-
error: subprocess-exited-with-error*
-
Ă— Getting requirements to build wheel did not run successfully.*
-
│ exit code: 1*
-
╰─> [33 lines of output]*
-
Traceback (most recent call last):*
-
File "/Users/bill/Projects/Software/Gramps/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>*
-
main()*
-
~~~~^^*
-
File "/Users/bill/Projects/Software/Gramps/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main*
-
json_out["return_val"] = hook(**hook_input["kwargs"])*
-
~~~~^^^^^^^^^^^^^^^^^^^^^^^^*
-
File "/Users/bill/Projects/Software/Gramps/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel*
-
return hook(config_settings)*
-
File "/private/var/folders/zc/pdd9cn15631ch_lpvmz4z4100000gn/T/pip-build-env-61a4njb6/overlay/lib/python3.13/site-packages/mesonpy/__init__.py", line 1050, in wrapper*
-
return func(*args, **kwargs)*
-
File "/private/var/folders/zc/pdd9cn15631ch_lpvmz4z4100000gn/T/pip-build-env-61a4njb6/overlay/lib/python3.13/site-packages/mesonpy/__init__.py", line 1072, in get_requires_for_build_wheel*
-
if os.environ.get('NINJA') is None and _env_ninja_command() is None:*
-
~~~~~~~~~~~~~~~~~~^^*
-
File "/private/var/folders/zc/pdd9cn15631ch_lpvmz4z4100000gn/T/pip-build-env-61a4njb6/overlay/lib/python3.13/site-packages/mesonpy/__init__.py", line 1027, in _env_ninja_command*
-
version = subprocess.run([ninja_path, '--version'], check=False, text=True, capture_output=True).stdout*
-
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*
-
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 556, in run*
-
with Popen(*popenargs, **kwargs) as process:*
-
~~~~~^^^^^^^^^^^^^^^^^^^^^^*
-
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 1038, in __init__*
-
self._execute_child(args, executable, preexec_fn, close_fds,*
-
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*
-
pass_fds, cwd, env,*
-
^^^^^^^^^^^^^^^^^^^*
-
...<5 lines>...*
-
gid, gids, uid, umask,*
-
^^^^^^^^^^^^^^^^^^^^^^*
-
start_new_session, process_group)*
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*
-
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 1974, in _execute_child*
-
raise child_exception_type(errno_num, err_msg, err_filename)*
-
OSError: [Errno 86] Bad CPU type in executable: '/usr/local/bin/ninja'*
-
[end of output]*
-
note: This error originates from a subprocess, and is likely not a problem with pip.*
error: subprocess-exited-with-error
Ă— Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
at the pip install PyGObject line. I can’t tell what it wants, though.
Thanks. This looks like it may be my best option.
Seems to be pretty upset with /usr/local/bin/ninja.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.