This project is archived and is in readonly mode.
_PQBackendPID error on Mac OS X SL
-
Daniele Varrazzo
Hello,
I have no experience with OS X, sorry.
I have recently found a few articles about compiling psycopg on OS X: see for example http://t.co/Sjfr8Kq and http://t.co/3uzxyDv : please try one of these. It would be nice if you could report back if any of these worked for you, thanks.
-
Daniele Varrazzo
Here is another article that may be helpful. Googling for _PQBackendPID "os x" returns many results.
-
Daniele Varrazzo
Another article reported by @sigep311: http://blog.jonypawks.net/2008/06/20/installing-psycopg2-on-os-x/
I've asked somebody to write a comprehensive article on the subject.
-
Daniele Varrazzo
- State changed from new to invalid
Closing this ticket as it's not a bug. Please use this article as a reference: we can continue the discussion there as it is a more visible place.
-
Charlie_X
============
Introduction
My advice is to use
MacPorts <http://macports.org>__ or something similar for installing Python and Postgres. There are several reasons for this: Apple only ships Python with a new version of the OS which can get outdated fairly quickly and they also use non-standard paths for installation which can make it difficult to follow any documentation on installing software on Unix systems. Using MacPorts keeps your software up to date and prevents you getting headaches working out what the error messages mean.There are also ports for psycopg2 which you can use. Or you can install the relevant virtualenv package. This depends largely on what you are doing. Virtualenv is more suitable for working with applications that others have written such as BFG, Zope or Django where it may be important to have specific versions of libraries. If you use virtualenv you can isolate a project from a system installation by using the --no-site-packages argument.
Using MacPorts
Installing psycopg2 for Python 2.6::
sudo port install py26-psycopg2
Installing manually
psycopg2 compiles without modification assuming pg_config can be found. By default MacPorts doesn't add the Postgres binaries to the path and without this psycopg2 fails to compile. You can either add the relevant path for Postgres binaries to your session variables or profile.::
export PATH=$PATH:/opt/local/lib/postgresql90/bin
Assuming you have "pip" installed::
sudo pip install psycopg2
Installing in a virtual environment
Create your virtual environment::
virtualenv-2.6 --no-site-packages myproject
This will create a folde myproject with it's own Python binary and library space. I highly recommend you do not use "activate" in the virtual environment as this messes around with environmental variables and can be extremely confusing::
cd myproject
bin/pip install psycopg2