You can install from an OS X PostgreSQL package. Allow it to change your memory settings and reboot (it's reversible by removing '/etc/sysctl.conf') - the README file (which tells you to do this yourself) is out of date. Then use (or get, if you haven't already and) EasyInstall.
Check where the PostgreSQL installer has put things - mine is here:
/Library/PostgreSQL/8.4/
Add this path to your .bash_login
or .bash_profile
file in your home directory (make one if you don't have it already):
export PATH="/Library/PostgreSQL/8.4/bin:$PATH"
Then (on an Intel iMac running OS 10.4.11 and Python 2.6) do:
sudo easy_install psycopg2
This found psycopg2 2.0.11 and (on my setup) gave the following readout:
warning: no files found matching '*.html' under directory 'doc'
warning: no files found matching 'MANIFEST'
zip_safe flag not set; analyzing archive contents...
Adding psycopg2 2.0.11 to easy-install.pth file
Installed /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/psycopg2-2.0.11-py2.6-macosx-10.3-i386.egg
Processing dependencies for psycopg2
Finished processing dependencies for psycopg2
So I guess I have no psycopg2
documentation... however, despite the warnings, I could then do:
python
>>>import psycopg2
>>>
Success? Perhaps. I haven't tried running anything yet, but getting a successful import was the first goal. BTW this was for Django.