Mac-native GNUmed


Installing GNUmed under Apple's Mac OS currently requires, in addition to several software packages listed lower down,

  • OS 10.6 or higher
  • PostgreSQL 9.1 or higher (9.3.x recommended)
  • gcc for compilation of psycopg2
  • comfort and familiarity with the use of the Terminal app, which can be found in the /Applications /Utilities folder

While Mac OS 10.8 comes with python 2.7 installed, it is wise to install an external python because Apple sometimes modifies the system python.

Caveats before proceeding:
  1. these instructions are provided without warrantee
  2. prior to production use, carefully assess all of your privacy, security, redundancy and downtime requirements


Advance checking

Run through the following checks for what is often lacking or inadequate on 'stock' Apple machines. Open a Terminal session and …

1. Check your $PATH

$ echo $PATH

The Mac OS default is typically /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin whereas after having installed an external python framework it should typically be like /Library/Frameworks/Python.framework/Versions/2.7/bin.

2. Check whether gcc is installed… it will be needed for installing/compiling psycopg2:
$ which gcc

If nothing is returned, you probably lack Command Line Tools … you can confirm the lack of a receipt thereof, using the command pkgutil

Obtain Command Line Tools by registering a free Apple Developer account and by using the methods at

If, for some reason, CLT needs to later be uninstalled, then see

There is no need to have Xcode if you are not developing, however to check whether it, too, is installed you can use either of the following commands, which should return a version:
  • xcode-select
  • /Developer/usr/bin/xcodebuild

CAVEAT if you are using Command Line Tools, do not also use the third-party OSX-GCC-Installer

3. Check the output of 'locale' … it should be something like the following, suited to your own language and locale:

$ locale

otherwise, see the Appendix to take care of this.

4. Check which pythons exist under /usr/bin, and which appears earliest in PATH, and its version
$ ls -al /usr/bin/python

$ which python

$ python --version

The active python should be like /Library/Frameworks/Python.framework/Versions/2.7/bin which is the minimum to support wxPython ≥ 2.9.x. More about Python is in the Appendix.

5. Check, in python, whether anyone had already installed psycopg2 and mx.DateTime on this machine. Each import line should, without error, return a new python prompt >>

$ python
    import mx.DateTime
    import psycopg2

Minimum downloads

Download at least the following:

   python (python-2.7.5-macosx10.6 selected) –  from as dmg
   wxpython (wxPython2.9-osx- selected) – from wxpython
   mxDateTime (egenix-mx-base-3.2.6-py2.7_ucs2-macosx-10.5-x86_64-prebuilt elected)
   postgres (postgresql-9.3.1-osx selected) – from EnterpriseDB
   psycopg2 (psycopg2-2.5.1 selected)


install python 2.7
install wxpython 2.9.5 cocoa
install egenix mxBase as follows:
   cd /Users/maverick/Downloads/egenix-mx-base-3.2.6-py2.7_ucs2-macosx-10.5-x86_64-prebuilt/
   /Users/maverick/Downloads/egenix-mx-base-3.2.6-py2.7_ucs2-macosx-10.5-x86_64-prebuilt/ install
install PostgreSQL

export PATH=/Library/PostgreSQL/9.3/bin:$PATH
sudo ln -s /Library/PostgreSQL/9.3/lib/libssl.1.0.0.dylib /usr/lib
sudo ln -s /Library/PostgreSQL/9.3/lib/libcrypto.1.0.0.dylib /usr/lib
sudo ln -s /Library/PostgreSQL/9.3/lib/libcrypto.dylib /usr/lib

cd /Users/maverick/Downloads/psycopg2-2.5.1
python /Users/maverick/Downloads/psycopg2-2.5.1/ install
verify with:

> import psycopg2
> quit()

Download and untar the GNUmed client tarball

the Mac version needs adjustments before being able to run it.
the check is broken for wxpython 2.9 on Mac, fix this by:
   In the client wxpython folder, find
   Go to line 30 where it says "3rd party libs"
   Comment out the last lines in that block ( wxversion.ensure.....)
   Save the file

cd /Users/maverick/Downloads/gnumed-client.1.3.9/client/

The above should work. Adjust values in =gm-from-vcs.conf= as may be desirable.

More downloads

LaTex support

BasicTex? (mactex-basic.pkg) requires just 87 Mb compared to 2.2 Gb for MacTex?, and is obtainable here. It ships with the very helpful command line utility tlmgr (TexLive Manager). The latter is documentedhere.

BasicTex? lacks some of the packages needed by base GNUmed, for example the file utf8x.def however TexLive Manager (as timgr) can look after this. We simply need to figure out which package provides = utf8x.def= and then install that package, which happens to be 'ucs':

  • sudo tlmgr update -self -all
  • tlmgr search --global --file utf8x.def
  • sudo tlmgr install ucs


For graphing, Aquaterm. For file downloads, wget.


- download server tarball
- untar
- see
   re  comment-out sections which depend on su -c
   re uncomment instances of #password in config files

commenting out in

2. When the user did not establish a .pgpass file to automatically provide the password as per

however in my own downloaded tarball I uncommented all instances of


in these conf files listed in bootstrap-latest.conf:



and I did not yet think to uncomment the occurrences in the various

   fixup_db-v10 … v18

zip modified server directory

sudo -i
(prompt for invoking user's password)


cp /Users/dad/Downloads/ /tmp
# or sh fromVersion toVersion
# e.g. sh 18 19

# in case of problems, copy log out of tmp to be able to access and email it
# example:
cp /tmp/gnumed-server.19.0/server/bootstrap/bootstrap-latest.log /Users/Shared/

Adjust db settings

  • run


Reference for the man pages for Mac OS:

Locale issues:

If locale properties are not fully set, perhaps they escaped being fully set for the machine, or for that user account … the UI and user language settings can be set within the OS via

System Preferences > "Language and Text" icon
"Language" pane/tab
"Formats" pane/tab (for Locales)

Profile issues - ~/.bash_login, ~/.bash_profile or ~/.profile

Apple no longer relies on a user ~/.bash_login, ~/.bash_profile or ~/.profile in that order of hierarchy. Apple instead stores values in the user's defaults database. See:

If for some reason the above are inaccessible by GNUmed one could perhaps, as offered at, create an /etc/.profile or user specific ~/.file containing
export LC_ALL=en_CA.UTF-8
export LANG=en_CA.UTF-8

General overview of configuration files at

Apparently [the Mac OS Terminal app skips .bashrc= and instead runs a login shell for each new terminal window calling =.bash_profile instead of .bashrc

Apparently under some modern unices, If you log in in a graphical environment (that is, if the program where you type your password is running in graphics mode), you don't automatically get a login shell that reads ~/.profile. Depending on the graphical login program, on the window manager or desktop environment you run afterwards, and on how your distribution configured these programs, your ~/.profile may or may not be read.

Python reference

Successful installation of a suitable non-Apple python can be checked with

$ echo $PATH

Machines whose OS has been serially migrated may contain, installed, multiple pythons which can be observed from
ls -l /System/Library/Frameworks/Python.framework/Versions/

About multiple versions and their handling:

Python ez_setup and pip

The Python people in their docs (e.g. suggest to install not only GCC (via Xcode or Command Line Tools or OSX-GCC_Installer) but also Homebrew and PIP however such installation may complicate any efforts by GNUmed project participants to help with diagnosis.

Here, however, is how it was at one point able to be installed:

# cd /Applications <--- was probably unnecessary

# now install 
sudo pip install psycopg2

$ pip list
egenix-mx-base (3.2.6)
pip (1.4.1)
psycopg2 (2.5.1)
setuptools (1.2)
wsgiref (0.1.2)
wxPython (
wxPython-common (
Topic revision: 20 Nov 2013, JamesBusser
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
Powered by Olark