Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

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 know there Have been a lot of similar questions asked but none address this issue as I far as I can tell. When I am trying to install the sextante plugin, or run PostGIS Manager in QGIS I receive the same message:

"Couldn't import Python module 'psycopg2' for communication with PostgreSQL database. Without it you won't be able to run PostGIS manager."

I have installed macports and successfully installed psycopg2 using the "sudo port install py26-psycopg2" command, even rebooted for good measure but no luck.

I have also gone through and installed it on every version of python on my machine which appears after entering "port select --list python"

How can I install port psycopg2 properly?

Please let me know what I am missing here, I am sure it is simple but it is confounding me so far.


share|improve this question
up vote 2 down vote accepted

Once again in, it must be reiterated that the QGIS versions of KyngChaos (1.8.x) and Larry Shaffer (master version) use the standard Apple Python and not the MacPorts Python, nor the Homebrew Python, nor other Python distribution...

More, on Mountain Lion, the default version of Apple Python is 2.7 and not 2.6

You can install whatever you want in MacPorts Python, it will be invisible to QGIS. If you want use the MacPorts Python, use the MacPorts version of QGIS.

see for example

And if you do not know Python well enough to compile psycopg2, the easiest solution is to download the version from Python Modules of KyngChaos for the Apple Python.

share|improve this answer
This is the clearest and most succinct answer to this question on Stack Exchange. on behalf of n00bs everywhere I thank you. – hdh May 3 '13 at 13:48

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.