Filed under: postgres
Today, I’ve been trying to get PsycoPG2 installed on my Macbook so that I can run through some tests and try and improve the user experience on Who’s Playing and hopefully increase it’s usage. I re-installed OSX the other week, and there’s still some little things like this to catch.
First off, I tried installing it via Macports, which worked Ok, but didn’t install it in a directory that the default Apple install of Python could see, it put it in the Macports directory. After a while I couldn’t find any way to change the install dir, so I ran:
which lost all my other libraries, and the Django framework. Not quite what I wanted really.
Will switch you back to the Apple install.
The easiest thing to do is just to download the latest psycopg2 tarball, and edit the setup.cfg file. I also installed Postgres from the official Mac binary, not from Macports, so I told it to use pg_config from that install. Uncomment the pg_config line and point it to your install of Postgres.
Then run setup.py
sudo python setup.py install
Update: For Snow Leopard users, you might also see the following error:
Symbol not found: _PQbackendPID
The solution, that I found on Kreegers blog, is to tell Snow Leopard that python needs to run in 32bit mode:
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
7 Comments so far
Leave a comment