Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to set up GeoDjango and installing PostGIS on my mac and when I am trying to


I am getting this error

checking PostgreSQL version... PostgreSQL 8.4.9
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking for PQserverVersion in -lpq... no
configure: error: could not find libpq

Is this alright or should i go ahead and execute



I have installed GeoServer Suite which has Postgres, should first install Postgres separately as well?


 PostGIS is now configured for x86_64-apple-darwin10.8.0

 -------------- Compiler Info ------------- 
  C compiler:           gcc -g -O2
  C++ compiler:         g++ -g -O2

 -------------- Dependencies -------------- 
  GEOS config:          /usr/local/bin/geos-config
  GEOS version:         3.3.3
  PostgreSQL config:    /usr/local/pgsql/bin/pg_config
  PostgreSQL version:   PostgreSQL 9.1.3
  PROJ4 version:        48
  Libxml2 config:       /usr/bin/xml2-config
  Libxml2 version:      2.7.3
  JSON-C support:       yes
  PostGIS debug level:  0
  Perl:                 /usr/bin/perl

 --------------- Extensions --------------- 
  PostGIS Raster:       disabled
  PostGIS Topology:     enabled

 -------- Documentation Generation -------- 
  xsltproc:             /usr/bin/xsltproc
  xsl style sheets:     

Does this mean that PostGIS is now installed? Why is the PostGIS Raster disabled?

Also when i follow the tutorial I am getting this error

createdb -E UTF8 template_postgis
createdb: could not connect to database postgres: FATAL:  role "root" does not exist

Then i checked for the command

sudo su - postgres

and it returns 1 for echo $?

share|improve this question
Sam, PostGIS seems to be installed (though I don't know what version you installed). The only way to know for sure is to create a Postgres database, load the PostGIS extensions into the database (docs for PostGIS 2), and test the setup by loading in spatial data. QGIS offers a nice interface to work with Postgres/PostGIS, and some plugins for loading shapefiles, etc. and managing your database. – dakcarto Apr 23 '12 at 20:26
Welcome to gis.stackexchange @Sam007. Please keep working on your question, adding new information as you advance. It's not helpful to open new threads with slightly altered content. – underdark Apr 23 '12 at 21:19
up vote 2 down vote accepted

Sam, if you are looking for Mac OS X installers for several osgeo tools, including PostgreSQL and PostGIS, check out Links to other downloads on left side of page.

EDIT Make sure to read the included README files, as they note the necessary additions to your PATH and other environment variables. Especially useful if you are building software against the installs.

EDIT 2 To address your posted question... PostGIS needs PostgreSQL, so you will need to add its current location to the include paths when configuring PostGIS. Use './configure --help' to see options.

share|improve this answer
i updated the error – Sam007 Apr 20 '12 at 23:02
Yup seems I found the soultion. Simply install brew. and then brew postgis and it takes care of everything – Sam007 Apr 20 '12 at 23:36
Ok it seems I am again stuck. I installed the Proj and GEOS before so how do I uninstall it now? – Sam007 Apr 20 '12 at 23:40
Did you install those via source? If so, and you have not removed/cleaned your build directory, you can 'usually' go back there and run make uninstall. Be aware, that if homebrew installed in similar places (after your source install), the source uninstall may remove bits of the homebrew install as well. You would then have to reinstall using homebrew, if it's broken. I highly recommend the frameworks setup for OSGeo on Mac, but glad to hear you found a solution with homebrew. – dakcarto Apr 21 '12 at 3:24
About your error above: if PQserverVersion can't be found, it may be that you installed the client-only version of PostgreSQL, instead of the server (and optionally client). Also, keep in mind that the default of PostgreSQL server is to server locally-only. You have to enable it in PostgreSQL's configuration files. – dakcarto Apr 21 '12 at 3:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.