Installing Django PostGIS Postgres on OS X: Version Hell

Ran into a day and half’s worth of trouble while trying to install postgis and I still haven’t resolved it yet. Some things to note so far:

  1. If you install postgis via brew, `brew install postgis`, it will also automagically install postgresql9.2.1 for you. So if you have a previous version of postgresql installed, you will now have 2!
  2. Django1.4 doesn’t play will with postgis2.0 for now. So, you have to install postgis1.5 (
  3. postgis1.5 doesn’t play well with postgresql9.2.1, so you to install postgresql9.1.x (
  4. So, the working versions to use together would be Django1.4.x with postgis1.5 and postgres9.1.x
  5. To NOT get the latests version of postgres from brew, follow this gist ( to install postgres9 which will link you to postgres9.08
  6. The crazy thing is trying to `brew install postgis15` gives me the following error [1]
  7. Client version of psql is different from the server version of postgres. If you run psql in terminal and you see something like `psql (9.2.1)`, it means the client and server versions are the same. If you see something like `psql (Client (9.2.1) Server (9.1.2))` (can’t remember the exact phrasing but the first number would be the client, the second number would be the server itself), it means the client and server versions are different.
  8. If you have a previous version of postgres, you would have had to run `initdb /usr/local/var/postgres`. You gotta move/delete this guy if you’re installing a new version of postgres and rerun the initidb command!
  9. `brew doctor` is your friend


Error in Question:

nai@nyc ~ $ brew install postgis15
==> Downloading
Already downloaded: /Users/nai/Library/Caches/Homebrew/postgis15-1.5.3.tar.gz
==> ./configure –with-projdir=/usr/local –with-pgconfig=/usr/local/Cellar/postgresql/9.2.1/bin/pg_config
==> make
num2_tuples = reltup->reltuples;
4 errors generated.
make[1]: *** [lwgeom_estimate.o] Error 1
make: *** [postgis] Error 2

Other Useful Links

6 thoughts on “Installing Django PostGIS Postgres on OS X: Version Hell

      • I was trying to build a development of openblock, firstly everything was cool, before trying to install Django. My error messages were “[] Error 1” , so I fix it by using “–no-python”, then it came out error message of “[uuid-ossp.o] Error 1”. I finally build it like this: “brew install postgresql9 –no-python –without-ossp-uuid”. And it works!
        I was justing wondering how it happened. And now it drives me crasy when i was setting openblock. Maybe I need to redo these in macport too.
        Thanks for replying!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s