pycopg2 build problems

devaru ajoys123 at gmail.com
Thu Sep 24 15:25:39 EDT 2009


On Sep 24, 2:14 am, phi... at semanchuk.com wrote:
> Quoting Wolodja Wentland <wentl... at cl.uni-heidelberg.de>:
>
>
>
> > On Wed, Sep 23, 2009 at 12:24 -0700, devaru wrote:
> >> I'm trying to install psycopg2 on my system. I followed the
> >> instruction in INSTALL file and gave the command
> >> python setup.py build
> >> running build
> >> running build_py
> >> running build_ext
> >> error: No such file or directory
>
> > I ran into this some days ago. The problem is not related to the
> > distribution you downloaded, but to missing information about PostgreSQL
> > itself.
>
> > IIRC the file in question is "/usr/bin/pg_config". The file is  
> > probably packaged
> > in some lib*-dev package on your distribution.
>
> That's the most common install problem with psycopg2 -- setup.py can't  
> find (or execute) pg_config which it needs to decide how to talk to  
> Postgres. I remember it giving a different (and more descriptive)  
> error but I haven't used psycopg2 recently.
>
> To the OP: if executing pg_config fails from the same command line in  
> which you're running setup.py, then Wolodja is absolutely correct. You  
> need to get pg_config on your path somewhere, or there might be an  
> environment variable you can set to tell setup where to find it if you  
> don't want it in your path.
>
> Good luck
> Philip
>
>
>
> > --- Debian example ---
> > $ apt-file search /usr/bin/pg_config
> > libpq-dev: /usr/bin/pg_config
> > --- snip ---
>
> > thanks for all the fish
>
> >     Wolodja
>
>

Thank you all.

Yes, as Philip and Wolodja have said, we need pg_config in the PATH
variable for psycopg2 to build.
Then I ran into a problem where I had to install the dependency
package python-devel.
Now psycopg2 installed fine.



More information about the Python-list mailing list